<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
' Dim objXMLHTTP, xml
' Set xml = Server.CreateObject("Microsoft.XMLHTTP")
'Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
' xml.Open "GET", "http://localhost/index.asp", False
' xml.Send
' Response.CharSet = "ISO8859_1"
' Response.CharSet = "ISO_LATIN_1"
' Response.CharSet = "gb2312"
' Response.CharSet = "utf-8"
' Response.write("这里是使用"&Server.HTMLEncode("<xmp>")&"标签之后显示出来的源代码")
' Response.Write("<xmp>")
' Response.Write(xml.ResponseText)
' Response.Write("</xmp>")
' Response.write("<BR><BR><BR>")
' Response.write("这里是没有使用"&Server.HTMLEncode("<pre>")&"标签所显示页面")
' Response.Write(xml.ResponseText)
' Set xml = Nothing
Set m_XMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
m_XMLHTTP.Open "get","http://localhost/index.asp",false,"",""
m_XMLHTTP.Send
m_data =m_XMLHTTP.ResponseBody
Set m_file = Server.CreateObject("Adodb.Stream")
m_file.Type = 1
m_file.open
m_file.Write m_data
m_file.SaveToFile Server.MapPath("/test.htm"), 2
m_file.Cancel
m_file.Close
set m_file=nothing
set m_XMLHTTP=Nothing
%>
不知道为什么,第一种方法总是得到乱码!而且是在ASP页面里,而在JSP,asp.net,PHP等一些程序里没有问题!和Jearol讨论了一上午,也没个结果,到是找到一些文章!再慢慢研究它了!
文章来源:http://computer.mblogger.cn/wucountry/posts/40753.aspx