📄 index.aspx
字号:
<%@ Page Language="VB" ContentType="text/html" %>
<%@ import Namespace="system.data" %>
<%@ import Namespace="system.data.oledb" %>
<script runat="server">
sub login(obj as object,e as eventargs)
dim intid as integer
intid=executeSql("select id from userinfor where username='" & txtusername.text & "' and password='" & txtpassword.text & "'","user.mdb")
if intid<>0 then
FormsAuthentication.setauthcookie(intid,false)
txtusername.visible="false"
txtpassword.visible="false"
Button1.visible="false"
Button2.visible="false"
hypercorn.visible="true"
hyperbean.visible="true"
hypercabbage.visible="true"
hypertomato.visible="true"
hypercayenne.visible="true"
labeleorr.visible="true"
labeleorr.text="登陆成功!"
else
labeleorr.visible="true"
labeleorr.text="用户名或密码错误,请重新输入!"
end if
end sub
function executeSql(sql as string,database as string) as integer
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0; data source="+server.MapPath("data/user.mdb"))
dim objcmd as new oledbcommand(sql,conn)
try
objcmd.connection.open()
return objcmd.executescalar()
catch ex as exception
response.Write(ex.message)
finally
objcmd.connection.close()
end try
end function
</script>
<!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; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-image: url(02.jpg);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {
font-size: x-large;
color: #3366FF;
}
-->
</style></head>
<body>
<form runat="server">
<table width="973" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="26" height="343"> </td>
<td width="304"> </td>
<td width="56"> </td>
<td width="290"> </td>
<td width="48"> </td>
<td width="110"> </td>
<td width="139"> </td>
</tr>
<tr>
<td height="40"> </td>
<td> </td>
<td> </td>
<td rowspan="5" valign="top">
<asp:HyperLink ID="hypercorn" ImageUrl="images/corn.gif" NavigateUrl="corn.aspx" runat="server" Visible="false"></asp:HyperLink>
<p>
<asp:HyperLink ID="hyperbean" ImageUrl="images/bean.gif" NavigateUrl="bean.aspx" runat="server" Visible="false"></asp:HyperLink>
</p> <p>
<asp:HyperLink ID="hypercabbage" ImageUrl="images/cabbage.gif" NavigateUrl="cabbage.aspx" runat="server" Visible="false"></asp:HyperLink>
</p> <p>
<asp:HyperLink ID="hypertomato" ImageUrl="images/tomato.gif" NavigateUrl="tomato.aspx" runat="server" Visible="false"></asp:HyperLink>
</p> <p>
<asp:HyperLink ID="hypercayenne" ImageUrl="images/cayenne.gif" NavigateUrl="cayenne.aspx" runat="server" Visible="false"></asp:HyperLink>
</p></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="16"></td>
<td rowspan="3" valign="top"><p align="center" class="style2">用户登陆</p>
<div align="center">用户名: <asp:TextBox ID="txtusername" ToolTip="请输入用户名" runat="server" />
</div>
<p align="center"> 密 码: <asp:TextBox ID="txtpassword" runat="server" TextMode="Password" /> </p>
<p align="center">
<asp:Button ID="button1" runat="server" Text="登陆" OnClick="login" />
<asp:Button ID="button2" runat="server" Text="注册"/> </p>
<p align="center">
<span><asp:Label ID="labeleorr" runat="server" Visible="false"></asp:Label> </p></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="84"></td>
<td> </td>
<td> </td>
<td valign="top"><img src="01.gif" width="110" height="84"></td>
<td> </td>
</tr>
<tr>
<td height="68"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="12"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="18"></td>
<td></td>
<td></td>
<td> </td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -