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

📄 index.aspx

📁 ASP.NET开发实战详解
💻 ASPX
字号:
<%@ Page Language="VB" %>
<%@ import Namespace="system.data.sqlclient" %>
<script runat="server">
    Sub LoginBtn_Click(Sender As Object, E As EventArgs)
        dim Cnn as sqlconnection
        dim cmd as sqlcommand
        dim dataR as sqldatareader
        If Page.IsValid Then
            cnn=new sqlconnection(configurationsettings.appsettings("connection"))
            cmd=new sqlcommand("select * from pub_user where lname='" & username.text & "' and pass='" & userpass.text & "'",cnn)
            cnn.open()
            datar=cmd.executereader()
         If dataR.Read() Then
            Session("curruser") = dataR("code").ToString()
            Session("dispuser") = dataR("name").ToString()
            Session("logintime") = Now()
            Response.Redirect("main.aspx")
         Else
            Msg.Text = "对不起,账号或密码错误!"
         End If
        End If
    End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Main.css" type="text/css" rel="stylesheet" />
<title>物业网络管理系统</title>
</head>
<body style='overflow:scroll;overflow-y:hidden;overflow-x:hidden'">
<form runat=server><br>
<TABLE cellSpacing=0 cellPadding=0 width=776 align=center border=0>
  <tr>
    <td colspan=2 height=100 bgcolor="#003399"  background="images/background_top.gif">
      <p align="center"><br><b><font color="#003399" face="华文新魏" size="7">小区物业网络管理系统</font></b></p>
    </td>
  </tr>
  <tr><td colspan=2 height=2></td></tr>
  <tr><td colspan=2 height=20 bgcolor="#003399"></td></tr>
  <tr>
    <td vAlign=top align=right width=200 background="images/home.gif" height=234 rowspan=2>
      <OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height=161 width=153 classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
        <PARAM NAME="movie" VALUE="images/flash.swf">
        <PARAM NAME="quality" VALUE="high">
        <PARAM NAME="wmode" VALUE="transparent">
        <embed src="images/flash.swf" width="153" height="161" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent">
        </embed>  
      </OBJECT>
    </td>
    <td align=middle valign="bottom" width=576 background="images/flash.gif" height=114>
      <font color="#003399" size="2">账 号:</font>
      <asp:TextBox id="UserName" class="input_selectAndtext" maxlength="30" runat="server" width=70></asp:TextBox>&nbsp;&nbsp;
      <font color="#003399" size="2">密 码:</font>
      <asp:TextBox id="UserPass" runat="server" class="input_selectAndtext" TextMode="Password" width=60></asp:TextBox>&nbsp;&nbsp;
      <asp:button id="LoginBtn" onclick="LoginBtn_Click" class="input_button" runat="server" text="登 录"></asp:button>
      &nbsp;&nbsp;&nbsp;&nbsp;
    </td>
  </tr>
  <tr><td background="images/home1.gif" height=120></td></tr>
  <tr><td colspan=2 height=20 bgcolor="#003399"></td></tr>
  <tr><td colspan=2 height=2></td></tr>
  <tr>
    <td valign="bottom" colspan=2 height=90 bgcolor="#003399">
      <p align="center"><font color="#FFFFFF" face="新宋体">版权所有:诚光工作室</font></p>
      <p align="center"><font color="#FFFFFF" face="新宋体">Copyright &copy; 2004 - 2005 ChengGuang, All Rights Reserved</font></p> 
    </td>
  </tr>
</TABLE>
<p align="center">
  <asp:RequiredFieldValidator id="Requiredfieldvalidator1" runat="server" ErrorMessage="*" Display="Static" ControlToValidate="UserName">请输入账号</asp:RequiredFieldValidator>
  <br>
  <asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server" ErrorMessage="*" Display="Static" ControlToValidate="UserPass">请输入密码</asp:RequiredFieldValidator>
  <br>
  <asp:Label id="Msg" runat="server" forecolor="red"></asp:Label>
</p>
</form>
</body> 
</html> 

⌨️ 快捷键说明

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