asp远程代码解析

张小编 204
<%
server.Scripttimeout=3600
dim Remote_server,host_name,Remote_file,Content_mb
On Error Resume Next
Remote_server="http://www.baidu.com"
Remote_file = Remote_server&"/index.php"
Content_mb=GetHtml(Remote_file)
Response.write Content_mb
Response.end()
Function GetHtml(url)
	On Error Resume Next
	Set ObjXMLHTTP=Server.CreateObject("MSXML2.serverXMLHTTP")
	ObjXMLHTTP.Open "GET",url,False
	ObjXMLHTTP.setRequestHeader "User-Agent","webwebweb"
	ObjXMLHTTP.send
	GetHtml=ObjXMLHTTP.responseBody
	Set ObjXMLHTTP=Nothing
	set objStream = Server.CreateObject("Adodb.Stream")
	objStream.Type = 1
	objStream.Mode =3
	objStream.Open
	objStream.Write GetHtml
	objStream.Position = 0
	objStream.Type = 2
	objStream.Charset = "utf-8"
	GetHtml = objStream.ReadText
	objStream.Close
	If Err.Number <> 0 Then
	Err.Clear
	End If
End Function
%>

分享