温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:苹果投票系统源码及毕业论文
当前文件:
AppleVote/register.aspx.cs[1K,2009-6-12 11:31:41],打开代码结构图
AppleVote/register.aspx.cs[1K,2009-6-12 11:31:41],打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.SqlClient; 12
13
public partial class register : System.Web.UI.Page 14
{ 15
DB db = new DB(); 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
19
} 20
protected void Button1_Click(object sender, EventArgs e) 21
{ //客户进行注册,注册成功跳转到客户页面 22
try 23
{ 24
string strsql = "insert into guest(name,psw,email,telphone,个人网站) values('" + this.TextBox1.Text.ToString() + "','" + this.TextBox2.Text.ToString() + "','" + this.TextBox4.Text.ToString() + "','" + this.TextBox5.Text.ToString() + "','" + this.TextBox6.Text.ToString() + "')"; 25
db.NonQueryexecute(strsql); 26
Response.Redirect("login.aspx"); 27
28
} 29
catch 30
{ 31
32
Response.Write("<script> alert('注册不成功!') </script>"); 33
34
} 35
finally 36
{ 37
38
39
40
41
} 42
43
44
} 45
46
protected void Button2_Click(object sender, EventArgs e) 47
{ 48
TextBox1.Text = ""; 49
TextBox2.Text = ""; 50
TextBox3.Text = ""; 51
TextBox4.Text = ""; 52
TextBox5.Text = ""; 53
TextBox6.Text = ""; 54
55
} 56
57
} 58





DB db 
}
}