在做网站开发的时候
常常需要获取
服务器的一些基本信息
怎么获取呢
请参阅下面的简单介绍
复制代码 代码如下:
//Server Name
"Server Name": ServerMachineName
"Server Domain": RequestServerVariables["Server_Name"]
"Server Port": RequestServerVariables["Server_Port"]
"Web Server Version": RequestServerVariables["Server_SoftWare"]//Path
"Virtual Request Path": RequestFilePath
"Physical Request Path": RequestPhysicalPath
"Virtual Application Root Path": RequestApplicationPath
"Physical Application Root Path": RequestPhysicalApplicationPath//Platform
"Operating System Installation Directory": EnvironmentSystemDirectory
"Net Version": EnvironmentVersionToString()
"Net Language": SystemGlobalizationCultureInfoInstalledUICultureEnglishName
"Server Current Time": DateTimeNowToString()
"System Uptime": TimeSpanFromMilliseconds(EnvironmentTickCount)ToString()
"Script Timeout": TimeSpanFromSeconds(ServerScriptTimeout)ToString()
//Get Request Headers
//eg:ConnectionAcceptAcceptCharsetAcceptEncodingAcceptLanguageUserAgent
foreach (string key in RequestHeadersAllKeys)
{
RequestHeaders[key];
}
//Get Server Variables
//eg:ALL_HTTPALL_RAWPATH_INFOURL
foreach (string key in RequestServerVariablesAllKeys)
{
RequestServerVariables[key];
}