您目前尚未登陆,请选择【登陆】或【注册
首页->留言本类->三层班级留言本源码>>Class/ModifyPass.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:三层班级留言本源码


当前文件路径:ClassSay/Class/ModifyPass.aspx.cs 文件类型
普通视图
		            
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源码大搜捕
代码片断 打包下载该项目完整源码:三层班级留言本源码

- ASP.NET宿舍管理系统源码

- Asp.net实现的彩色下拉框源码

- 最简单无刷新聊天室源码

- 小孔子文章管理系统(Ajax+C#..

- 菜菜灰数据库通用留言本V1.0源码

- 三层网络收音机源码

- ASP.NET通用权限管理系统1.0..

- CodematicS3三层结构示例项目..

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号