如題,我想用VB(.NET)製作一個登陸器,能夠登陸PHP網頁的登陸框。只有兩個數据:用戶名和密碼,沒有驗證碼。
網頁源代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/style.css" type="text/css">
<title>用户登录</title>
</head>
<script type="text/javascript" src="include/md5.js"></script><script language="JavaScript" type="text/JavaScript">
function Login(form){
if(form.name.value == "") alert("请输入编号");
else if(form.passwd.value == "") alert("请输入密码");
else{
   form.action = "login.php?Cmd=login";
   form.passwd.value = hex_md5(form.passwd.value);
  form.submit();
}
}
</script>
<script language="JavaScript">
  function   keyEnter(iKeyCode)   {   
  var   srcElement=window.event.srcElement;   
    
  if(iKeyCode!=13)   return   false;   
  if   (srcElement.tagName=="INPUT"||srcElement.tagName=="SELECT")   {   
  var   i   =   0   
  while   (srcElement!=srcElement.form.elements[i])   
  i++;
  while(typeof(srcElement.form.elements[i+1])=="object"   &&   srcElement.form.elements[i+1].type=="hidden")   
  i++;
  if(typeof(srcElement.form.elements[i+1])=="object")   
  srcElement.form.elements[i+1].focus();   
  srcElement.form.elements[i+1].select();   
  }   
  return   false;   
  }   
</script><body onload="document.all.name.focus()">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%">
  <TR>
    <TD VALIGN="MIDDLE" ALIGN="CENTER">
      <FORM NAME="login" METHOD="post" ACTION="login.php" onkeypress='keyEnter(event.keyCode)'>
<table width="360" height="200" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>校园一卡通系统&nbsp;&nbsp;1.0</td>
  </tr>
  <tr>
    <td><hr noshade size='1'></td>
  </tr>
  <tr>
    <td>编&nbsp;&nbsp;号:<INPUT TYPE="text" NAME="name" SIZE="12"></td>
  </tr>
  <tr>
    <td>密&nbsp;&nbsp;码:<INPUT TYPE="password" NAME="passwd" SIZE="12"></td>
  </tr>
  <tr>
    <td><INPUT TYPE="button" NAME="login" VALUE="登录" onClick="Login(this.form)"></td>
  </tr>
  <tr>
    <td><hr noshade size='1'></td>
  </tr>
  <tr>
    <td><font size='2'>欢迎使用</font></td>
  </tr>
</table>
</FORM>
    </TD>
  </TR>
</TABLE>
</BODY>
</HTML>登陸之後包含兩部分:導航欄(左側邊)和網頁正文。導航欄代碼如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/style.css" type="text/css">
<title>菜单</title>
<SCRIPT language=javascript>
function showson(ss){
if (ss.style.display == 'none'){
ss.style.display = '';
}else{
ss.style.display = 'none';
}
}function showmenu(ss){
for(i=1;i<100;i++){
obj=document.getElementById("s"+i);
if(ss=='open'){
if(obj && obj.style.display=="none"){
obj.style.display="";
}
}else{
if(obj && obj.style.display==""){
obj.style.display="none";
}
}
}

}
</script>
</head><body>
<center>
<TABLE width='158' cellSpacing='1' cellPadding='2' bgcolor='#D3D6FE' align=center border=0>
<TR><TD bgcolor='#D3D6FE'><IMG src='images/title.gif'> 
</TD></TR></TABLE><TABLE><TR><TD><TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2'>
<TR valign='middle' bgcolor=#ff50D2><TD height='24' background='images/table.gif'>
<b><span onmousedown='showson(s0);' title='当前状态' style='CURSOR: hand'>当前状态</span></b></TD></TR></TABLE>
<TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2' id=s0><TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;欢迎 莫业瀚 使用本系统</TD></TR>
<TR bgColor='#E1DEFA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#E1DEFA'><TD>&nbsp;
<A href='login.php' target='_parent'>安全退出</A>
</TD></TR>
<TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;
<A href='modselfpasswd.php' target='main'>修改密码</A>
</TD></TR>
<TR bgColor='#E1DEFA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#E1DEFA'><TD>&nbsp;
<A href='main.php' target='main'>查看首页</A>
</TD></TR>
<TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;
<A href='#' onclick="return showmenu('open')">全部展开</A>&nbsp;&nbsp;
<A href='#' onclick="return showmenu('close')">全部收缩</A>
</TD></TR>
</TABLE><TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2'>
<TR valign='middle' bgcolor=#ff50D2><TD height='24' background='images/table.gif'>
<b><span onmousedown='showson(s1);' title='' style='CURSOR: hand'>基本信息</span></b></TD></TR></TABLE>
<TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2' style='display:none' id=s1><TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;
<A href='userinfo.php?action=mc' title='' target='main'>个人基本信息</A>
</TD></TR>
</TABLE><TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2'>
<TR valign='middle' bgcolor=#ff50D2><TD height='24' background='images/table.gif'>
<b><span onmousedown='showson(s2);' title='' style='CURSOR: hand'>在线教学</span></b></TD></TR></TABLE>
<TABLE width='158' cellspacing='1' cellpadding='2' bgcolor='#ff50D2' style='display:none' id=s2><TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;
<A href='artic_list.php' title='' target='main'>网上课堂</A>
</TD></TR>
<TR bgColor='#E1DEFA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#E1DEFA'><TD>&nbsp;
<A href='list_stu_works.php' title='' target='main'>查看作业</A>
</TD></TR>
<TR bgColor='#EAE7FA' onMouseOver=this.style.backgroundColor='#FEEAE9' onMouseOut=this.style.backgroundColor='#EAE7FA'><TD>&nbsp;
<A href='exams_list.php' title='' target='main'>在线考试</A>
</TD></TR>
</TABLE></TD></TR></TABLE></center>
</body>
</html>程序在完成登陸之後應該在左邊顯示導航欄,在選定導航欄某項後能在右邊顯示相應的網頁正文。請高手賜教!!

解决方案 »

  1.   

    TD VALIGN="MIDDLE" ALIGN="CENTER">
          <FORM NAME="login" METHOD="post" ACTION="login.php" onkeypress='keyEnter(event.keyCode)'>
    <table width="360" height="200" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>校园一卡通系统&nbsp;&nbsp;1.0</td>
      </tr>
      <tr>
        <td><hr noshade size='1'></td>
      </tr>
      <tr>
        <td>编&nbsp;&nbsp;号:<INPUT TYPE="text" NAME="name" SIZE="12"></td>
      </tr>
      <tr>
        <td>密&nbsp;&nbsp;码:<INPUT TYPE="password" NAME="passwd" SIZE="12"></td>
      </tr>
      <tr>
        <td><INPUT TYPE="button" NAME="login" VALUE="登录" onClick="Login(this.form)"></td>
      </tr>webbrowser1.document.all("name").value="账号"
    webbrowser1.document.all("passwd").value="密码"
    webbrowser1.document.all("login").submit
      

  2.   

    满屏的<>,看得眼睛都尖了