ASP 中使用 HTTP 协议发送参数详解
更新时间:2006年12月21日 00:00:00 作者:
<%@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>
<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>
相关文章
方便的大家admin及admin888 经过 md5加密后16位和32位代码
方便的大家admin及admin888 经过 md5加密后16位和32位代码...2007-03-03Asp DatePart 函数的语法详解(用于计算日期并返回指定的时间间隔)
ASP(VBScript) 参考手册中,已经对 DatePart 作了说明,但其对第一个参数的解释太过书面,造成令人误解,现重新解释一下2012-07-07python array[dict] 某个按照某个key去重
这篇文章主要介绍了python array[dict] 某个按照某个key去重,需要的朋友可以参考下2006-06-06javascript asp教程More About Recordsets
javascript asp教程More About Recordsets...2007-03-03
最新评论