ASP中使用HTTP协议发送参数详解
2023-06-13 09:13:51 时间
<%@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>
相关文章
- ASP结合Oracle:实现强大的数据库应用(asporacle)
- 使用MSSQL与ASP构建高效网站(mssqlasp)
- 深入浅出:Linux 架构学习 HTTP 协议(http协议linux)
- 教程使用ASP连接MySQL,视频教程掌握一步搞定(asp连接mysql视频)
- ASP技术可以驱动MySQL吗(asp能连接mysql吗)
- ASP如何使用代码登录MySQL数据库(asp登陆mysql代码)
- ASP操作MySQL数据库实现简单便捷功能(asp用mysql数据库)
- ASP连接MySQL的实现方式(asp文件连接mysql)
- 数据库探索ASP环境搭建MySQL数据库方法(asp搭建mysql)
- ASP与MySQL结合最佳网站开发方案(asp接mysql)
- ASP技术点缀MySQL之美展示精彩绚丽(asp展示mysql)
- 使用ASP连接Oracle报错解决方案(asp连oracle报错)
- ASP与Oracle数据库操作实例最佳实践之路(asp oracle实例)
- ASP与Oracle配合实现数据写入(asp oracle写入)
- ASP中一个用VBScript写的随机数类
- asp错误的几种处理方式
- 几个ASP.NET小技巧
- asp静态页面的另一种思路
- ASP字符串大写转换成小写ASP小写转换成大写ucaselcase
- asp.netApplication_AcquireRequestState事件,导致Ajax客户端不能加载
- asp.net(C#)生成无限级别菜单
- Asp.net内置对象之Request对象(概述及应用)
- ASP.Net缓存总结及分析分享
- Asp.Net的FileUpload类实现上传文件实例
- Sqlserver2005安装时ASP.Net版本注册要求警告的解决方法