Wu.Country@侠缘

勤学似春起之苗,不见其增,日有所长; 辍学如磨刀之石,不见其损,日所有亏!

导航

[导入]Microsoft.XMLHTTP,让我郁闷了一上午的事情!

<%@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

posted on 2005-07-05 19:15  Wu.Country@侠缘  阅读(791)  评论(0编辑  收藏  举报