您的位置:程序门 -> vb ->



vb 问题


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


vb 问题
发表于:2007-08-21 22:12:36 楼主
我想用inet控间post   学号和密码
学号密码输入页
<html>

<head>
<title> 辽宁大学选课系统 </title>
<link   href= "style.css "   rel= "stylesheet "   type= "text/css ">
<script   language= "javascript1.2 "   src= "nocache.js "> </script>
</head>

<body   bgcolor= "#eae2f3 "> <h3>
请输入你的学号和密码: </h>   <br>
<form   action= "/pls/wwwbks/bks_login2.login "   method= "post "   onsubmit= "addjym(this,2) ">
<table   border= "0 "   bgcolor= "#f2edf8 ">
    <tr   bgcolor= "#eae2f3 ">
        <td   bgcolor= "#e2d8ef "> 学号: </td> <td> <input   name= "stuid "   type= "text "   size= "12 "   maxlength= "12 "> </td>
    </tr>
    <tr   bgcolor= "#eae2f3 ">
            <td   bgcolor= "#e2d8ef "> 密码: </td>
            <td> <input   name= "pwd "   type= "password "   size= "10 "   maxlength= "10 "> </td>
    </tr>
</table>

<br>
<table   border= "0 "   bgcolor= "#f2edf8 ">
    <tr   bgcolor= "#eae2f3 ">
        <td   bgcolor= "#e2d8ef "> <input   type= "submit "   value= "   确认   "> &nbsp; </td>
        <td   bgcolor= "#e2d8ef "> <input   type= "reset "   value= "   重置   "> </td>
    </tr>
</table>
</form>

</body>
</html>
nocache.js
//使用说明:
//链接不传参数:addjym   (this,0),链接需要传参数:addjym   (this,1),
//form表单不传参数:addjym   (this,2),form表单传参数:addjym   (this,3)。
//原有的链接不能有jym2005=   这个字串,如果有会被删除


        function   addjym(thisobject,hasparam){
//产生随机数
              var   time=((new   date().gettime()*9301+49297)%233280)/(233280.0);
var   rand=math.random();  
//alert( 'rand   is: '+rand+ '   time   is: '+time);
time=(time+rand)*9301;
var   indx=-2;

//表单的处理
if(hasparam> 1){    
    while(indx!=-1){
        indx=thisobject.action.lastindexof( 'jym2005= ');
        if(indx!=-1){                    
            thisobject.action=thisobject.action.substring(0,indx-1);
            //alert( 'current   action   is:   '+thisobject.action);
                        }
                    }
    if(hasparam==2){   //无参数
        thisobject.action=thisobject.action+ '?jym2005= '+time;        
    }else{
        thisobject.action=thisobject.action+ '&jym2005= '+time;
    }
    //alert( 'form   action   is:   '+thisobject.action);
    return   true;
}

//链接的处理;
              indx=-2;
while(indx!=-1){
    indx=thisobject.href.lastindexof( 'jym2005= ');
    if(indx!=-1){                    
        thisobject.href=thisobject.href.substring(0,indx-1);
        //alert( 'current   href   is:   '+thisobject.href);
                    }
                }
if(hasparam==0){     //无参数
    thisobject.href=thisobject.href+ '?jym2005= '+time;
}else{
    thisobject.href=thisobject.href+ '&jym2005= '+time;
}
//alert( 'the   last   href   is:   '   +thisobject.href);
        }


private   sub   command1_click()

dim   myurl   as   string,   send_data   as   string,   my_head   as   string,   t   as   date,   ran   as   double
'
t   =   ((time()   *   9301   +   49297)   mod   233280)   /   (233280)
ran   =   rnd()
t   =   (t   +   ran)   *   9301
myurl   =   "http://xxx.xxx.xxx/aaa/aaa/aaa.login "
send_data   =   "id= "   &   trim(text1.text)   &   "&pwd= "   &   trim(text2.text)   &   "&jym2005= "   &   trim(str(t))
my_head   =   "content-type:   application/x-www-form-erlencoded "
inet1.EXECute   myurl,   "post ",   send_data,   my_head

end   sub

private   sub   inet1_statechanged(byval   state   as   integer)

dim   get_data   as   string
  do   until   inet1.stillEXECuting   =   false

  loop
if   state   =   12   then
get_data   =   inet1.getchunk(1024)
text3.text   =   get_data
end   if
end   sub

输入正确的id   密码   但总是提示id或密码错误   怎么办啊?


快速检索

最新资讯
热门点击