⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.aspx

📁 网络图书管理系统 可以在线查询。预定等
💻 ASPX
字号:
<%@ import namespace="system.data"%>
<%@ import namespace="system.data.oledb"%>
<html>
<script language="vb" runat="server">
sub page_load()
row4.visible=false
end sub
sub b1_click(obj as object,e as eventargs)
dim str1 as string 
dim str2 as string 
str1="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("lt.mdb")
str2="select * from user1 where id='"&trim(user_id.text)&"' and passwd='"&trim(pw.text)&"'"
dim ad as oledbdataadapter
ad=new oledbdataadapter(str2,str1)
dim ds as dataset=new dataset()
ad.fill(ds,"user")
if ds.tables("user").rows.count=0 then
row4.visible=true
session("pass")="no"
else
session("pass")="ok"
session("name")=ds.tables("user").rows(0).item("name")
row4.visible=false
 if ds.tables("user").rows(0).item("dj")="0" then
 response.redirect("super.aspx")
 else 
 response.redirect("")
 end if
end if
end sub
</script>
<form id="form1" runat="server">
<asp:table id="table1" runat="server" backcolor="silver" gridlines="both" horizontalalign="center" >
<asp:tablerow id="row1" runat="server" >
<asp:tablecell id="cell1" runat="server" horizontalalign="right">输入用户号</asp:tablecell>
<asp:tablecell id="cell2" runat="server"><asp:textbox id="user_id" runat="server"/></asp:tablecell></asp:tablerow>


<asp:tablerow id="row2" runat="server">
<asp:tablecell id="cell3" runat="server" horizontalalign="right">密    码</asp:tablecell>
<asp:tablecell id="cell4" runat="server"><asp:textbox textmode="password"  id="pw"  runat="server"/>
</asp:tablecell></asp:tablerow>

<asp:tablerow id="row3"  runat="server">
<asp:tablecell id="cell5" runat="server" Colspan=2 horizontalalign="center">
<asp:button id="b1" runat="server" onclick="b1_click" text="登 录"/>
</asp:tablecell>
</asp:tablerow>

<asp:tablerow id="row4"  runat="server">
<asp:tablecell id="cell6" runat="server" Colspan=2 horizontalalign="center">
<font color="red">警告:   输入数据有误</font></asp:tablecell>

</asp:tablerow>
</asp:table>

<asp:requiredfieldvalidator id="name_check" runat="server" controltovalidate="user_id" Display="none" errormessage="未输入姓名" />
<asp:requiredfieldvalidator id="pw_check" runat="server" controltovalidate="pw" Display="none" errormessage="未输入密码" />
<asp:validationsummary id="sum" runat="server" showsummary="false" showmessagebox="true" headertext="下面是验证出错信息" displaymode="bulletlist"/> 

</form>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -