当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp中xmlhttp组件发包

ASP
asp #include命令
推荐下天枫常用ASP函数封装,推荐大家使用
asp最简单最实用的计数器
用asp实现的iframe批量替换工具
ASPWebPack 代码 提供下载
asp分页生成html的程序脚本代码
比较不错的asp单表单字段多条件查询
asp下用replace非正则实现代码运行功能的代码
UpdatePanel触发javascript脚本的方法附代码
生成EAN13标准的条形码的ASP代码实例
asp空间奸商查询系统
ASPWebPack(整站文件备份系统) v1.0.2 黑客也用
ASP+FSO可视化目录编历(可增、删、改)下载
提高ASP效率的五大技巧
ASP生成随机字符串(数字+大小写字母)的代码
ASP下存储过程编写入门全接触
利用 cache 做对比静态页的网页技术
ASP生成静态文件编码为UTF-8格式的HTML文件
ASP下的两个防止SQL注入式攻击的Function
asp下的风讯用的SQL通用防注入模块提供了

ASP 中的 asp中xmlhttp组件发包


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

asp中xmlhttp组件发包
写的一个小偷函数,注意红色代码部分,其他的自己添加吧!
Function PostHttpPageFrom(HttpUrl,stra,FromUrl)
Dim Http
Set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "POST",HttpUrl,False
Http.setrequestheader "content-length",len(stra) Http.setrequestheader "content-
type","application/x-www-form-urlencoded"
Http.setrequestheader "Referer",FromUrl
Http.send stra
If Http.Readystate<>4 then
Set Http=Nothing
GetHttpPage="$False$"
Exit function
End if
PostHttpPageFrom=bytesToBSTR(Http.responseBody,"gb2312") 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.Open1 d)
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function