⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userpage.aspx.cs

📁 校友管理系统(可以通过excel导入和导出校友信息)
💻 CS
字号:
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();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -