华域联盟 .Net asp.net获取服务器基本信息的方法代码

asp.net获取服务器基本信息的方法代码

复制代码 代码如下:

//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];

 }
您可能感兴趣的文章:

  • ASP.NET操作各类时间段获取方法汇总
  • ASP.NET实现根据IP获取省市地址的方法
  • ASP.NET使用Subtract方法获取两个日期之间的天数
  • ASP.net中获取客户端参数操作系统信息
  • asp.net获取HTML表单File中的路径的方法
  • asp.net获取网站绝对路径示例
  • asp.net获取select值的方法
  • Asp.net获取当前目录的方法小结
  • ASP.NET中获取URL重写前的原始地址详解
  • ASP.NET中实现获取调用方法名

本文由 华域联盟 原创撰写:华域联盟 » asp.net获取服务器基本信息的方法代码

转载请保留出处和原文链接:https://www.cnhackhy.com/51502.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部