The database table only has two columns: username and password.
<form id="form1" runat="server">
<p class="biaodan">
用户名:<asp:TextBox ID="use" runat="server" onKeyUp="value=value.replace(/[\W]/g,'')" MaxLength="12" OnTextChanged="use_TextChanged"></asp:TextBox>
<br />
密 码:<asp:TextBox ID="pwd" runat="server" onKeyUp="value=value.replace(/[\W]/g,'')" MaxLength="12" OnTextChanged="pwd_TextChanged"></asp:TextBox>
<br />
验证码:
<%--<span id="code" class="nocode">验证码</span> <input type="text" class="input" /> --%>
<input type="text" id="inputCode" />
<br/><p class="code" id="checkCode" onclick="createCode()" ></p> <a href="#" onclick="createCode()">换一张</a>
<br/>
<asp:Button ID="check" runat="server" Text="登录" Width="100px" OnClick="btn_login_Click" />
</p>
</form>
In the .cs file corresponding to the page, there is a btn_login_Click method. In this method, the user name and password are obtained, and the database is checked to see if there is corresponding data.