1.用asp.net怎样写个登录注册怎么写,登录登录希望有个简单的注册注册案例,基于C#的源码源码组态软件源码分析
用asp.net怎样写个登录注册怎么写,希望有个简单的登录登录案例,基于C#的注册注册环保设备网站源码
注册页面:
<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('请输入用户名!!源码源码c 获取网站源码!登录登录');</script>");
return;
}
///链接数据库
///sql="insert into 表 (字段username,注册注册字段password)values(username,password)";
///执行sql语句
Response.Write("<script>alert('注册成功');</script>");
}
}
登录跟注册差不多,就是源码源码将sql语句换成查询,如果有成功,登录登录否则失败
注册注册