zoukankan      html  css  js  c++  java
  • [导入]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
    ================================
      /\_/\                        
     (=^o^=)  Wu.Country@侠缘      
     (~)@(~)  一辈子,用心做一件事!
    --------------------------------
      学而不思则罔,思而不学则怠!  
    ================================
  • 相关阅读:
    日报9.4
    日报9.3
    低级错误整理
    树状数组求逆序对 笔记与思路整理
    st表、树状数组与线段树 笔记与思路整理
    Luogu P1098 字符串的展开
    Luogu P1816 忠诚
    jmeter cookie管理器 使用方法---新手学习记录1
    kali nessus 安装插件失败解决方法
    https tomcat 证书搭建
  • 原文地址:https://www.cnblogs.com/WuCountry/p/305732.html
Copyright © 2011-2022 走看看