求一源码:c#和asp做的简单登陆注册功能 求一源码:c#和asp做的简单登陆注册功能我有一年的JAVA开发经验,现在想学.NET,请大家给个源码参考下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //登陆 protected void btnLogin_Click(object sender, EventArgs e) { string uid = this.txtuid.Text; string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtpwd.Text, "MD5"); if (BLLHelper.IsHaveUid(uid, pwd)) { Session["user"] = this.txtuid.Text; Response.Redirect("Myproject.aspx"); } else { Response.Write("<script>alert('用户名或密码错误');</script>"); CreateCourse(); } } } <table style="width: 80%;" align="center"> <tr> <td class="style1"> 用户名: </td> <td class="style2"> <asp:TextBox ID="txtuid" runat="server" Width="185px"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="rfvuid" runat="server" ErrorMessage="用户名不能为空" ControlToValidate="txtuid"></asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style1"> 密码: </td> <td class="style2"> <asp:TextBox ID="txtpwd" runat="server" TextMode="Password" style="margin-left: 0px; margin-bottom: 0px" Width="185px"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="rfvpwd" runat="server" ErrorMessage="密码不能为空" ControlToValidate="txtpwd"></asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="3" align="center"> <asp:Button ID="btnLogin" runat="server" Text="登陆" onclick="btnLogin_Click" /> <asp:Button ID="btnRegist" runat="server" Text="注册" CausesValidation="false" onclick="btnRegist_Click" /> </td> </tr> </table> 51aspx.com里很多 protected void Imgbtn_ok_Click(object sender, ImageClickEventArgs e) { if (Page.IsValid) { Sys_User user = SysUserBLL.SelectByUserId(Util.FormatInputStr(this.txtUser.Text)); if (user != null) { if (!user.PassWord.Equals(txtPwd.Text.Trim())) { new Jscript(this, "您输入的密码不对!").Show(); return; } else { Session.Add("UserId", user.UserId); this.Response.Write("<script language='javascript'>window.open('general/index.aspx','_self')</script>"); } } else { new Jscript(this, "您没有任何权限!").Show(); return; } } } 请教winform程序用sqlite数据库如何打包部署??还有sqlite数据连接的路径应该如何写? 【求助】 生成N个连续12位数字,从1开始,前面补0 c# 里可以画文本框吗 repeater绑定后怎么输出值呢?急啊 图中的小窗口是怎么做出来的? 熟悉WCF的请进 如何定时监控 文本提取字符串问题 进程结束后托盘中程序的图标不自动消失? 如何判断string变量是否为空? serialport类中的read函数 c#怎么通过代码启动QQ
protected void btnLogin_Click(object sender, EventArgs e)
{
string uid = this.txtuid.Text;
string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtpwd.Text, "MD5");
if (BLLHelper.IsHaveUid(uid, pwd))
{
Session["user"] = this.txtuid.Text;
Response.Redirect("Myproject.aspx");
}
else
{
Response.Write("<script>alert('用户名或密码错误');</script>");
CreateCourse();
}
}
} <table style="width: 80%;" align="center">
<tr>
<td class="style1">
用户名:
</td>
<td class="style2">
<asp:TextBox ID="txtuid" runat="server" Width="185px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="rfvuid" runat="server" ErrorMessage="用户名不能为空" ControlToValidate="txtuid"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style1">
密码:
</td>
<td class="style2">
<asp:TextBox ID="txtpwd" runat="server" TextMode="Password"
style="margin-left: 0px; margin-bottom: 0px" Width="185px"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="rfvpwd" runat="server" ErrorMessage="密码不能为空" ControlToValidate="txtpwd"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="btnLogin" runat="server" Text="登陆" onclick="btnLogin_Click" />
<asp:Button ID="btnRegist" runat="server" Text="注册" CausesValidation="false"
onclick="btnRegist_Click" />
</td>
</tr>
</table>
protected void Imgbtn_ok_Click(object sender, ImageClickEventArgs e)
{
if (Page.IsValid)
{
Sys_User user = SysUserBLL.SelectByUserId(Util.FormatInputStr(this.txtUser.Text));
if (user != null)
{
if (!user.PassWord.Equals(txtPwd.Text.Trim()))
{
new Jscript(this, "您输入的密码不对!").Show();
return;
}
else
{
Session.Add("UserId", user.UserId);
this.Response.Write("<script language='javascript'>window.open('general/index.aspx','_self')</script>");
}
}
else
{
new Jscript(this, "您没有任何权限!").Show();
return;
}
}
}