您的位置:程序门 -> web 开发 -> asp



xmlhttp模拟用户登陆网站,怎么做?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


xmlhttp模拟用户登陆网站,怎么做?
发表于:2007-02-03 12:15:23 楼主
xmlhttp模拟用户登陆网站,怎么做?

用户名和密码都是确定的

例如登陆sina的邮箱
发表于:2007-02-03 13:56:381楼 得分:0
该回复于2007-12-28 16:41:55被管理员或版主删除
发表于:2007-02-03 15:13:112楼 得分:0
<script     type= "text/vbscript "   language= "vbscript ">   function   urlencoding(byval   vstrin) dim   strreturn   strreturn   =   " "         for   i   =   1   to   len(vstrin)                 thischr   =   mid(vstrin,i,1)                 if   abs(asc(thischr))   <   &hff   then                           strreturn   =   strreturn   &   thischr                 else                         innercode   =   asc(thischr)                         if   innercode   <   0   then                           innercode   =   innercode   +   &h10000                         end   if                         hight8   =   (innercode     and   &hff00)\   &hff                         low8   =   innercode   and   &hff                         strreturn   =   strreturn   &   "% "   &   hex(hight8)   &     "% "   &           hex(low8)                 end   if         next         urlencoding   =   strreturn end   function function   bytes2bstr(byval   vin) strreturn   =   " " for   i   =   1   to   lenb(vin) thischarcode   =   ascb(midb(vin,i,1)) if   thischarcode   <   &h80   then strreturn   =   strreturn   &   chr(thischarcode) else nextcharcode   =   ascb(midb(vin,i+1,1)) strreturn   =   strreturn   &   chr(clng(thischarcode)   *   &h100   +   cint(nextcharcode)) i   =   i   +   1 end   if next bytes2bstr   =   strreturn end   function


  </script>           <script   type= "text/javascript ">                 var   xmlhttp   =   new   activexobject( "msxml2.xmlhttp ");         xmlhttp.open( "post ", "http://entry.mail.126.com/cgi/login?hid=10010102&lightweight=1&language=0&style=-1 ",false);         xmlhttp.setrequestheader( "content-type ", "application/x-www-form-urlencoded ")         //xmlhttp.setrequestheader( "charset ", "gb2312 ");         var   parm   =   "domain= "+escape( "126.com ");         parm+= "&language=0 ";         parm+= "&bcookie= ";         parm+= "&user= "+escape( "aaaa ");         parm+= "&pass= "+escape( "*********** ");         parm+=   "&style=-1 ";       //   parm+=   "&remuser= ";         //parm+=   "&secure=0 ";         parm+=   "&enter.x= "+escape( "登   录 ");         xmlhttp.send(parm);                     var   result   =   bytes2bstr(xmlhttp.responsebody)                         var   a   =   window.open( "about:blank ");         a.document.write(result);         xmlhttp   =   null;     </script>
发表于:2007-02-03 19:01:243楼 得分:0
楼上的代码调试过吗?
我这没法运行,说xmlhttp.setrequestheader( "content-type ", "application/x-www-form-urlencoded ")这没有权限。


快速检索

最新资讯
热门点击