?? zhuce.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace _123
{
/// <summary>
/// zhuce 的摘要說明。
/// </summary>
public class zhuce : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.TextBox TextBox3;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;
protected System.Web.UI.WebControls.Image Image1;
protected System.Web.UI.WebControls.ImageButton ImageButton2;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此處放置用戶代碼以初始化頁面
}
#region Web 窗體設計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.RequiredFieldValidator2.DataBinding += new System.EventHandler(this.ImageButton1_Click);
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.ImageButton2.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton2_Click);
this.RequiredFieldValidator1.DataBinding += new System.EventHandler(this.ImageButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("WebForm1.aspx");
}
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//
SqlConnection conn=new SqlConnection("Data Source=.;Database=toupiao;Integrated Security=SSPI");
conn.Open();
string name=TextBox1.Text;
string password=TextBox2.Text;
//
if(TextBox2.Text==TextBox3.Text)
{
string sql="insert into userinfo(name,password) values(\'"+name+"\',\'"+password+"\')";
SqlCommand com=new SqlCommand(sql,conn);
int a=com.ExecuteNonQuery();
if(a==1)
Label5.Text="注冊成功";
Response.Redirect("WebForm1.aspx");
}
else
Label5.Text="確認密碼與密碼不一致";
/*string sql="insert into userinfo(name,password) values(\'"+name+"\',\'"+password+"\')";
SqlCommand com=new SqlCommand(sql,conn);
int a=com.ExecuteNonQuery();
if(a==1)
Label5.Text="注冊成功";
else
Label5.Text="注冊失敗";
*/
// Response.Redirect("WebForm1.aspx");
}
private void ImageButton1_Click(object sender, System.EventArgs e)
{
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -