?? add_users.aspx.cs
字號:
?using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SMS;
public partial class add_Users : System.Web.UI.Page
{
OPDataBase op = new OPDataBase();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string sql = "insert into Users (UserName,Password,Power)values('" + TextBox1_name.Text + "','" + PassWord_box.Text + "','" + RadioButtonList1.SelectedValue.ToString() + "')";
if (PassWord_box.Text!="" && TextBox1_name.Text != "")
{
try
{
op.BindCommand (sql);
Response.Write("<script>alert('成功!')</script>");
}
catch
{
Response.Write("<script>alert('失?。?#039;)</script>");
}
}
else
{
Response.Write("<script>alert('用戶名和密碼不能為空!')</script>");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1_name.Text = "";
PassWord_box.Text = "";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -