最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > asp教程

XMLHTTP获取web访问头信息和网页代码

日期:11-13    来源:    作者:

<%YXh中国设计秀

Function BytesToBstr(body,Cset)YXh中国设计秀
    dim objstreamYXh中国设计秀
    set objstream = Server.CreateObject("adodb.stream")YXh中国设计秀
    objstream.Type = 1YXh中国设计秀
    objstream.Mode =3YXh中国设计秀
    objstream.OpenYXh中国设计秀
objstream.Write bodyYXh中国设计秀
    objstream.Position = 0YXh中国设计秀
    objstream.Type = 2YXh中国设计秀
    objstream.Charset = CsetYXh中国设计秀
    BytesToBstr = objstream.ReadTextYXh中国设计秀
    objstream.CloseYXh中国设计秀
    set objstream = nothingYXh中国设计秀
End FunctionYXh中国设计秀

url=request.form("url")YXh中国设计秀
if trim(url)<>"" thenYXh中国设计秀
    set xml = Server.CreateObject("MSXML2.xmlhttp.5.0")YXh中国设计秀
    xml.open "GET",url, FalseYXh中国设计秀
    xml.sendYXh中国设计秀
    bo = BytesToBstr(xml.ResponseBody,"UTF-8")YXh中国设计秀
    header = xml.GetAllResponseHeadersYXh中国设计秀
    set xml = nothingYXh中国设计秀
end ifYXh中国设计秀

%>YXh中国设计秀
<html>YXh中国设计秀

<head>YXh中国设计秀
<title>XMLHTTP测试</title>YXh中国设计秀
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">YXh中国设计秀
</head>YXh中国设计秀

<body bgcolor="#D4D0C8" topmargin="20" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">YXh中国设计秀

<div align="center">YXh中国设计秀
    <table border="1" width="770px" cellspacing="0" cellpadding="0" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="356">YXh中国设计秀
        <tr>YXh中国设计秀
            <form method="post">YXh中国设计秀
                <td align="center" height="50">YXh中国设计秀
                <input type="text" name="url" style="width:700;height:20" value="<%=url%>">YXh中国设计秀
                <input type="submit" value="查看"> </td>YXh中国设计秀
            </form>YXh中国设计秀
        </tr>YXh中国设计秀
        <tr>YXh中国设计秀
            <td align="center" height="124">YXh中国设计秀
            <textarea id="Textarea2" name="Textarea2" rows="7" cols="105"><%=header%></textarea></td>YXh中国设计秀
        </tr>YXh中国设计秀
        <tr>YXh中国设计秀
            <td height="230" align="center">YXh中国设计秀
            <textarea id="Textarea1" name="Textarea1" rows="14" cols="105"><%=bo%></textarea></td>YXh中国设计秀
        </tr>YXh中国设计秀
    </table>YXh中国设计秀
</div>YXh中国设计秀

</body>YXh中国设计秀

</html>YXh中国设计秀

本文引用地址:/bc/article_46491.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明