现在的位置: 首页 >> 网站编程 >> ASP >> ASP使用HTTP 协议,发送参数
添加时间:2005-12-4 来源:CSDN 作者:
ASP使用HTTP 协议,发送参数

<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift-JIS">
<SCRIPT LANGUAGE="JavaScript">
<!--
 function SelText(){
  var oRangeRef = document.body.createTextRange();
  alert(oRangeRef.text);
 }
//-->
</SCRIPT>
<%
function getHTTPPage(url)
    dim Http
    set Http=server.createobject("MSXML2.XMLHTTP")
    'Http.open "GET",url,false
 Http.open "POST",url,false
    Http.send()
    if Http.readystate<>4 then
        exit function
    end if
    'getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
 getHTTPPage=bytesToBSTR(Http.responseBody,"Shift-JIS")
    set http=nothing
    if err.number<>0 then
 err.Clear
 end if 
end function

Function BytesToBstr(body,Cset)
        dim objstream
        set objstream = Server.CreateObject("adodb.stream")
        objstream.Type = 1
        objstream.Mode =3
        objstream.Open
        objstream.Write body
        objstream.Position = 0
        objstream.Type = 2
        objstream.Charset = Cset
        BytesToBstr = objstream.ReadText
        objstream.Close
        set objstream = nothing
  
End Function
%>

<title></title>
</head>

<body onload="SelText()">
<%
Dim Url,Html
'Url="http://localhost/CSharpWebAppTest/WebForm1.aspx?tmp=33333"
'Url=http://localhost/CSharpWebAppTest/WebForm1.aspx
Url= "http://www.whois.sc/221.216.169.120"
'Url="http://localhost/akira/default.asp"
Html = getHTTPPage(Url)
Response.write Html
%>
</body>
</html>


上一篇:网站生成静态页面攻略 下一篇:Response.redirect实现页面重定向
大部分文章摘自网上,如有侵犯您的权益请与我们联系,我们会第一时间进行处理,谢谢! [ 打印文章 ] [ 关闭窗口 ]
推荐文章
·ASP下载系统防盗链方法
·尝尝ASP.NET中的小甜饼
·细细品味ASP.NET (四)
·ASP计数器设计详解-2
·升级MD5.ASP,打造完全动态不重
·用ASP设计网站在线人数统计程序
·ASP中使用SQL语句操作数据库
·ASP中函数调用对参数的影响
·Asp无组件文件上传的实例
·在ASP中使用SQL语句之2:用WHERE
相关文章
 
最新文章
·ASP下载系统防盗链方法
·ASP能读写注册表
·ASP 中健壮的页结构的异常处理
·在SQL Server中保存和输出图片
·使用ASP.NET加密口令
·web.config一个中文解释
·尝尝ASP.NET中的小甜饼
·用asp.net实现的把本文推荐给好
·开发BtoC电子商务系统(ASP.NET)
·保护 XML Web 服务免受黑客攻击
Google