1.用asp.net怎样写个登录注册怎么写,注册希望有个简单的页源案例,基于C#的码注面源码openthreads源码
用asp.net怎样写个登录注册怎么写,希望有个简单的册页案例,基于C#的注册androidstudio 登录界面源码
注册页面:
<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语句换成查询,如果有成功,页源否则失败
码注面源码