<%@import namespace="system.data"%>
<%@import namespace="system.data.sqlclient"%>
<script language="vb" runat="server">
sub denglu_click(sender as object, e as eventargs)
   dim mystring as string
   dim myconnection as sqlconnection
   mystring="server=localhost;uid=sa;pwd=;database=zhaopin"
   myconnection=new sqlconnection(mystring)
   myconnection.open
   dim ds as dataset
   dim drow as datarow
   dim dtable as datatable
   dim coldrow as datarowcollection
   dim myadapter as new sqldataadapter("select userid from userinfo where 
userid='"&request.form("zhanghao")&"'and userpsw='"&request.form("mima")&"'",myconnection) 
   myadapter.fill(ds,"tabuserinfo")
   dtable=ds.tables("tabuserinfo")
   coldrow=dtable.rows
   if coldrow.count<>0 then
    response.redirect("mainframe.aspx")
   else
    response.write("好")
    end if
    myconnection.close
end sub
</script>
<html>
<body>
<form runat="server">
<p><font size="5">帐号:
<input type="text" id="zhanghao" runat="server"></font>
</p>
<p><font size="5">密码:
<input type="password" id="mima" runat="server"></font>
</p>
<font size="5"><input type="button" runat="server" value="登 陆" 
onserverclick="denglu_click"></font>
</form>
</body>
</html>



 
											





 
	    

 
	