Http-Post(Msxml2.xmlHttp,Get,Post数据)

发布:2011-04-08 09:35   点击555次   评论:0


Function retuText(send_URL,user,pw)
  PostStr = "?a=b&u="&user&"&p="&pw
  Response.Write "<br>"&Len(PostStr)&"<br>"
  Set Retrieval = Server.CreateObject("Msxml2.xmlHttp") ''Microsoft.XMLHTTP
  With Retrieval
 .Open "POST",send_URL,False," ", " "
 .setRequestHeader "Content-Length",len(PostStr)
 .setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
 .Send(PostStr)
 retuText = .ResponseText
  End With
  Set Retrieval = Nothing
End Function

s = ""
for i=1 to 32012 ''32K
  Randomize
  p = 65+Int(26*Rnd()) '' 0 ~ (rMax-1)
  s = s&Asc(p)&""
next
Response.Write "<br>Len(s):"&len(s)

a1 = "http://www.dg.gd.cn/dgnews/view.asp?ID=132DBFA55DB7BATE133KPWKH"
a2 = "http://localhost:240/u/demo/ext/xtemp/http-get.asp"
url = a2
user = "test12"
pw = "pw123423"&s

te=retuText(url,user,pw)
Response.Write "<br>Len(te):"&Len(te)&"<br>"
Response.Write "<br>"&vbcrlf&"<!--"&vbcrlf&te&vbcrlf&"--><br>"
Response.Write "<br>"&Now()




  Dim oHttp,bHttp(2),sPost,sUrl
  sPost = smsXmlUser&xData&"&_PeaceRndID="&Timer()
  sUrl = xUrl&xAct&".action"''&sPost
  ''Response.Write "<br>"&sUrl&":"&sPost&"<br>"
  Set oHttp = Server.CreateObject("Msxml2.xmlHttp") ''Microsoft.XMLHTTP
  With oHttp
 .Open "POST",sUrl,False," ", " "
 .setRequestHeader "Content-Length",Len(sPost)
 .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
 .Send(sPost)
 ''.Open "GET",sUrl,False," ", " "
 ''.Send()
 bHttp(0) = oHttp.Status
 bHttp(1) = oHttp.StatusText
 bHttp(2) = oHttp.ResponseText
  End With
  Set oHttp = Nothing

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:2.162/28.294(ms); 7(sql)/2.88(MB); comm:news/detail; Upd:2024-11-15 20:33:43