当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP 中使用 HTTP 协议发送参数详解

ASP
ASP编程入门进阶(十二):ASP技巧累加(一)
ASP编程入门进阶(十三):Ad & Content Rotator
ASP编程入门进阶(十四):Browser & Linking
ASP编程入门进阶(十五):组件Counters
一些简单的ASP练习
ASP编程入门进阶(十六):FSO组件之驱动器操作
ASP编程入门进阶(十七):FSO组件之文件夹操作
ASP编程入门进阶(十八):FSO组件之文件操作(上)
ASP编程入门进阶(十八):FSO组件之文件操作(中)
ASP编程入门进阶(十八):FSO组件之文件操作(下)
ASP编程入门进阶(十九):ASP技巧累加(二)
ASP中有关双引号,单引号以及&号的解释
ASP编程入门进阶(二十):ADO组件之显示数据记录
ASP编程入门进阶(二十):ADO组件之插入数据记录
ASP编程入门进阶(二十):ADO组件之分页程序
ASP编程入门进阶(二十):ADO组件之修改数据记录
ASP编程入门进阶(二十):ADO组件之删除数据记录
ASP初学者常犯的几个错误(ZT)
无组件上传图片之文件采用方案
ASP编程入门进阶(二十):ADO组件之查询数据记录

ASP 中使用 HTTP 协议发送参数详解


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 45 ::
收藏到网摘: n/a

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