Asp.net 获取服务器信息

网友投稿 1002 2022-08-27

Asp- 获取服务器信息

Asp- 获取服务器信息

Response.Write("服务器机器名:" + Server.MachineName);

Response.Write("
");

Response.Write("服务器IP地址:" + Request.ServerVariables["LOCAL_ADDR"]);

Response.Write("
");

Response.Write("服务器域名:" + Request.ServerVariables["SERVER_NAME"]);

Response.Write("
");

Response.Write(".NET解释引擎版本:" + ".NET CLR" + System.Environment.Version);

Response.Write("
");

Response.Write("服务器操作系统版本:" + System.Environment.OSVersion.ToString());

Response.Write("
");

Response.Write("服务器IIS版本:" + Request.ServerVariables["SERVER_SOFTWARE"]);

Response.Write("
");

Response.Write("HTTP访问端口:" + Request.ServerVariables["SERVER_PORT"]);

Response.Write("
");

Response.Write("虚拟目录的绝对路径:" + Request.ServerVariables["APPL_RHYSICAL_PATH"]);

Response.Write("
");

Response.Write("执行文件的绝对路径:" + Request.ServerVariables["PATH_TRANSLATED"]);

Response.Write("
");

Response.Write("Session总数:" + Session.Contents.Count.ToString());

Response.Write("
");

Response.Write("Application总数:" + Application.Contents.Count.ToString());

Response.Write("
");

Response.Write("缓存Cache总数:" + Cache.Count.ToString());

Response.Write("
");

Response.Write("服务器主机:" + Request.ServerVariables["HTTP_HOST"]);

Response.Write("
");

Response.Write("服务器区域语言:" + Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]);

Response.Write("
");

Response.Write("访客信息:" + Request.ServerVariables["HTTP_USER_AGENT"]);

Response.Write("
");

Response.Write("服务器CPU个数:" + System.Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS"));

Response.Write("
");

Response.Write("服务器CPU类型:" + System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"));

你也许会问 HTTP_HOST 和 SERVER_NAME 的值是一样的,它们之间有什么区别?

通常服务器默认端口为80,HTTP_HOST将省略不显示端口号。如果服务器是非80端口,则HTTP_HOST显示端口号。

简单的说就是: HTTP_HOST = SERVER_NAME:SERVER_PORT

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:hdu 2516 取石子游戏(博弈,找规律)
下一篇:素因子分解 (快速筛法&&试除法)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~