1.用asp.net怎样写个登录注册怎么写,登陆登陆希望有个简单的注册注册案例,基于C#的源码源码框架源码分析教程
用asp.net怎样写个登录注册怎么写,希望有个简单的登陆登陆案例,基于C#的注册注册龙将2源码
注册页面:
<head runat="server">
<title>注册</title>
</head>
<body>
<form id="form1" runat="server">
<div>
用户名:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
密 码:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="注册" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
代码:
public partial class Default7 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string username = this.TextBox1.Text.Trim();
string password = this.TextBox2.Text.Trim();
if(string.IsNullOrEmpty(username))
{
Response.Write("<script>alert('请输入用户名!!源码源码网红酒店源码!登陆登陆');</script>");
return;
}
///链接数据库
///sql="insert into 表 (字段username,注册注册字段password)values(username,password)";
///执行sql语句
Response.Write("<script>alert('注册成功');</script>");
}
}
登录跟注册差不多,就是源码源码将sql语句换成查询,如果有成功,登陆登陆否则失败
注册注册2024-11-25 09:58
2024-11-25 08:57
2024-11-25 08:13
2024-11-25 08:04
2024-11-25 08:02
2024-11-25 07:31