using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace MESWebSite.Manage { public partial class Index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string username = ""; string userID = ""; if (Request.Cookies["LoginUserInfo"] != null) { username = Request.Cookies["LoginUserInfo"]["RealName"].Trim(); userID = Request.Cookies["LoginUserInfo"]["UserID"].Trim(); } if (!string.IsNullOrWhiteSpace(username)) { lbl_UserName.Text = HttpUtility.UrlDecode(username, System.Text.Encoding.UTF8); txt_UserID.Text = userID; } else { Response.Write(""); } this.ServerInformation.Text = "服务器地址: " + Request.ServerVariables.Get("Remote_Host").ToString() + "

" + "浏览器: " + Request.Browser.Browser + "

" + "浏览器版本号: " + Request.Browser.MajorVersion + "

" + "客户端平台: " + Request.Browser.Platform + "

" + "服务器ip: " + Request.ServerVariables.Get("Local_Addr").ToString() + "

" + "服务器名: " + Request.ServerVariables.Get("Server_Name").ToString() + "

" + "服务器地址: " + Request.ServerVariables["Url"].ToString() + "

" + "客户端提供的路径信息: " + Request.ServerVariables["Path_Info"].ToString() + "

" + "与应用程序元数据库路径相应的物理路径: " + Request.ServerVariables["Appl_Physical_Path"].ToString() + "

" + "通过由虚拟至物理的映射后得到的路径: " + Request.ServerVariables["Path_Translated"].ToString() + "

" + "执行脚本的名称: " + Request.ServerVariables["Script_Name"].ToString() + "

" + "接受请求的服务器端口号: " + Request.ServerVariables["Server_Port"].ToString() + "

" + "发出请求的远程主机的IP地址: " + Request.ServerVariables["Remote_Addr"].ToString() + "

" + "发出请求的远程主机名称IP地址: " + Request.ServerVariables["Remote_Host"].ToString() + "

" + "返回接受请求的服务器地址IP地址: " + Request.ServerVariables["Local_Addr"].ToString() + "

" + "返回服务器地址IP地址: " + Request.ServerVariables["Http_Host"].ToString() + "

" + "服务器的主机名、DNS地址或IP地址: " + Request.ServerVariables["Server_Name"].ToString() + "

" + "提出请求的方法比如GET、HEAD、POST等等: " + Request.ServerVariables["Request_Method"].ToString() + "

" + "如果接受请求的服务器端口为安全端口时,则为1,否则为0: " + Request.ServerVariables["Server_Port_Secure"].ToString() + "

" + "服务器使用的协议的名称和版本: " + Request.ServerVariables["Server_Protocol"].ToString() + "

" + "应答请求并运行网关的服务器软件的名称和版本: " + Request.ServerVariables["Server_Software"].ToString() + "

" ; } /// /// 退出按钮 /// /// /// protected void lbtn_quit_Click(object sender, EventArgs e) { if (Request.Cookies["LoginUserInfo"] != null) Request.Cookies["LoginUserInfo"].Expires = DateTime.Now.AddDays(-1); System.Web.Security.FormsAuthentication.SignOut(); Session.Abandon(); Session.RemoveAll(); Session.Clear(); this.Response.Redirect("../Login.aspx"); this.Response.End(); } } }