?? userpage.aspx.cs
字號(hào):
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;
namespace UserInfoManage
{
/// <summary>
/// Summary description for UserPage.
/// </summary>
public class UserPage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblUser075;
protected System.Web.UI.WebControls.DataGrid userInfoDtGrid075;
protected System.Web.UI.WebControls.Button btnEdtPwd075;
protected System.Web.UI.WebControls.Button btnEdtInfo075;
protected System.Web.UI.WebControls.Button btnLogout075;
protected System.Web.UI.WebControls.Image imgFace075;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// Put user code to initialize the page here
string name=(string)this.Session["username"];
lblUser075.Text=name.ToUpper()+"'s information";
System.Data.OleDb.OleDbDataAdapter adpt=(System.Data.OleDb.OleDbDataAdapter)this.Session["adpt"];
adpt.SelectCommand.CommandText="select * from userinfo where name='"+name+"'";
DataSet ds=new DataSet();
adpt.Fill(ds);
DataTable dt=ds.Tables["userinfo"];
userInfoDtGrid075.DataSource=dt;
userInfoDtGrid075.DataBind();
if(System.IO.Directory.Exists(Request.MapPath(Request.ApplicationPath)+ "\\face\\"+name))
{
string[] face=System.IO.Directory.GetFiles(Request.MapPath(Request.ApplicationPath)+"\\face\\"+name);
imgFace075.ImageUrl=Request.ApplicationPath+"\\face\\"+name+face[0].Substring(face[0].LastIndexOf("\\"));
}
else
{
imgFace075.ImageUrl=Request.ApplicationPath+ "\\face\\default.bmp";
//this.Response.Write(Request.MapPath(Request.ApplicationPath)+ "\\face\\default.bmp");
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnEdtPwd075.Click += new System.EventHandler(this.btnEdtPwd075_Click);
this.btnEdtInfo075.Click += new System.EventHandler(this.btnEdtInfo075_Click);
this.btnLogout075.Click += new System.EventHandler(this.btnLogout075_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnEdtInfo075_Click(object sender, System.EventArgs e)
{
this.Server.Transfer("UserChangeInfo.aspx");
}
private void btnEdtPwd075_Click(object sender, System.EventArgs e)
{
this.Server.Transfer("UserChangePwd.aspx");
}
private void btnLogout075_Click(object sender, System.EventArgs e)
{
this.Server.Transfer("Login.aspx");
this.Session.Abandon();
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -