Asp.net源码专业站
首页->留言本类->三层班级留言本源码>>Class/ModifyPass.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:三层班级留言本源码
当前文件:文件类型 ClassSay/Class/ModifyPass.aspx.cs[2K,2009-6-12 11:36:01]打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.IO; 12using UserInfoLib; 13 14public partial class ModifyPass : System.Web.UI.Page 15{ 16 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if (!Page.IsPostBack) 20 { 21 if ((Session["User"] != null) && (Session["Root"] != null) && (Session["Root"].ToString()) != "0") 22 { 23 this.LabelName.Text = Session["User"].ToString(); 24 UserInfo user = new UserInfo(); 25 user.UserName = Session["User"].ToString(); 26 DataSet table = user.SeleUpdate(); 27 this.TextBoxPassword.Text = table.Tables[0].Rows[0]["UserPassword"].ToString(); 28 this.TextBox1.Text = table.Tables[0].Rows[0]["UserImage"].ToString(); 29 this.ViewState["table"] = table; 30 this.ButtonClose.Attributes.Add("onclick", "window.close();"); 31 } 32 else 33 { 34 this.Response.Write("<script>alert('您还没有登陆!');</script>"); 35 this.Response.Redirect("index.aspx"); 36 //this.Page.RegisterStartupScript("closewindow", "<script>window.close()</script>"); 37 } 38 } 39 } 40 protected void ButtonExit_Click(object sender, EventArgs e) 41 { 42 this.TextBoxPassword.Text = ""; 43 } 44 protected void ButtonModify_Click(object sender, EventArgs e) 45 { 46 UserInfo user = new UserInfo(); 47 user.UserName = this.LabelName.Text; 48 user.UserPassword = this.TextBoxPassword.Text; 49 user.UserImage = this.TextBox1.Text; 50 if (FileUpload1.FileName == null || FileUpload1.FileName == "") 51 { 52 DataSet table = (DataSet)ViewState["table"]; 53 user.UserLable = table.Tables[0].Rows[0]["UserLable"].ToString(); 54 } 55 else 56 { 57 58 this.FileUpload1.PostedFile.SaveAs(this.Server.MapPath("UPimage") + "\\" + Path.GetFileName(FileUpload1.PostedFile.FileName)); 59 user.UserLable = "~\\UPimage\\" + this.FileUpload1.FileName; 60 } 61 user.Update(); 62 this.TextBoxPassword.Text = ""; 63 this.Response.Write("<script>alert('修改成功');</script>"); 64 this.Response.Write("<script>window.setTimeout('window.close()',0)</script>"); 65 } 66} 67
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:三层班级留言本源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146