In doing website development, often need to get, the server's some basic information, how to get it, see the following brief introduction:
copy Code code as follows:
//server name
"server name": Server.machinename
"Server Domain": request.servervariables["SERVER_NAME" ]
Server Port: request.servervariables["Server_port"]
"Web server Version: request.servervariables[" server _software "]//path
Virtual Request Path": Request.filepath
"Physical Request path": Request.PhysicalPath
" Virtual application root path: Request.applicationpath
Physical application root path: Request.physicalapplicationpath//platform
Operating System installation Directory: Environment.systemdirectory
. NET Version: Environment.Version.ToString ()
". NET Language": System.Globalization.CultureInfo.InstalledUICulture.EnglishName
Server Current time: DateTime.Now.ToString ()
System Uptime: Timespan.frommilliseconds (Environment.tickcount). ToString ()
Script Timeout: Timespan.fromseconds (server.scripttimeout). ToString ()
//get Request Headers
//eg:connection,accept,accept-charset,accept-encoding,accept-lAnguage,user-agent ...
foreach (string key in Request.Headers.AllKeys)
{
request.headers[key];
}
//get Server Variables
//eg:all_http,all_raw,path_info,url ...
foreach (string key in Request.ServerVariables.AllKeys)
{
Request.servervariables[key];
}