温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:chx99个人主页源码
当前文件:
chx99/admin/config.aspx.cs[2K,2009-6-12 11:35:58],打开代码结构图
chx99/admin/config.aspx.cs[2K,2009-6-12 11:35:58],打开代码结构图1using System; 2
using System.Collections; 3
using System.Configuration; 4
using System.Data; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.HtmlControls; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.WebControls.WebParts; 11
using System.Data.OleDb; 12
13
public partial class admin_config : System.Web.UI.Page 14
{ 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
if (!IsPostBack) 18
{ 19
DataBind(); 20
} 21
} 22
protected void DataBind() 23
{ 24
try 25
{ 26
config fg = new config(); 27
OleDbDataReader dr = fg.GetInfo(); 28
TextBox1.Text = dr["Icp"].ToString(); 29
TextBox2.Text = dr["Cont"].ToString(); 30
TextBox3.Text = dr["Diy"].ToString(); 31
dr.Close(); 32
} 33
catch 34
{ 35
Page.RegisterStartupScript("a","<script>alert('数据读取失败,请重试!');</script>"); 36
} 37
} 38
39
protected void Button1_Click(object sender, EventArgs e) 40
{ 41
try 42
{ 43
config fg = new config(); 44
fg.SetIcp(TextBox1.Text); 45
Page.RegisterStartupScript("b", "<script>alert('修改成功!');</script>"); 46
} 47
catch 48
{ 49
Page.RegisterStartupScript("b", "<script>alert('修改失败,请重试!');</script>"); 50
} 51
} 52
protected void Button2_Click(object sender, EventArgs e) 53
{ 54
try 55
{ 56
config fg = new config(); 57
fg.SetCont(TextBox2.Text); 58
Page.RegisterStartupScript("b", "<script>alert('修改成功!');</script>"); 59
} 60
catch 61
{ 62
Page.RegisterStartupScript("b", "<script>alert('修改失败,请重试!');</script>"); 63
} 64
65
} 66
protected void Button3_Click(object sender, EventArgs e) 67
{ 68
try 69
{ 70
config fg = new config(); 71
fg.SetDiy(TextBox3.Text); 72
Page.RegisterStartupScript("b", "<script>alert('修改成功!');</script>"); 73
} 74
catch 75
{ 76
Page.RegisterStartupScript("b", "<script>alert('修改失败,请重试!');</script>"); 77
} 78
} 79
} 80






}
}