<%Sub CreateHTMLPage(getURL,postFile)
'Note on above line: you can actually skip it if your asp file
' to collect the output of the ASP page as a string
Set TearObj = Nothing
Set objFile = Server.CreateObject("Scripting.FileSystemObject")
%>
<%
%>
<%response.redirect "http://www.yourdomain.co.uk/asptear.asp"%>
Hosting Systems - Serving your business - for all your windows hosting requirements.
ASP Tear Example
<HTML>
<BODY>
'to get the complete URL of the active file you want to run
Dim getPage
getPage = "http://www.yourdomain.com/" & getURL
'to make a composite physical address of the "HTML" file
'you want to write to
Dim postPage
postPage = MapPAth & postFile
Const Request_POST = 1
Const Request_GET = 2
Dim TearObj
Set TearObj = CreateObject("SOFTWING.ASPTear")
TearObj.Referrer = "http://www.anglingnews.net/"
TearObj.ForceReload = True
'that you are calling has a similar declaration in its HEAD part,
'like:
'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
strRetrieval = TearObj.Retrieve(getPage, Request_GET, "", "", "")
'this is a direct copy from the documentation of ASPTear
If Err.Number <> 0 Then
Response.Write "<b>"
If Err.Number >= 400 Then
Response.Write "Server returned error: " & Err.Number
Else
Response.Write "Component/WinInet error: " & Err.Description
End If
Response.Write "<b>"
Response.End
End If
Dim objFile, objTStream
Set objTStream = objFile.OpenTextFile(postPage, 2, True, 0)
objTStream.Write(strRetrieval)
Set objTStream = Nothing
Set objFile = Nothing
strRetrieval = ""
getPage = ""
postpage = ""
End Sub
' Response.Flush
Call CreateHTMLPage("asptear.asp","asptear.htm")
</BODY>
</HTML>