服务器探针
Code
<%@ Page Language="C#"%>
<%@ Import Namespace="System.Globalization"%>
<%@ Import Namespace="Microsoft.Win32" %>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Diagnostics" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>asp.net 探针</title>
<link href="inc/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<br />
<p style=" text-align:left; margin-left:10px;">
<strong class="title">服务器探针</strong><P style=" text-align:left; margin-left:40px; line-height:22px;">
<%
Response.Write("<strong>计算机名:</strong>");
Response.Write("http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "<br />");
Response.Write("<strong>IP地址:</strong>");
Response.Write(Request.ServerVariables["LOCAl_ADDR"] + "<br />");
Response.Write("<strong>域名:</strong>");
Response.Write(Request.ServerVariables["SERVER_NAME"].ToString() + "<br />");
Response.Write("<strong>端口:</strong>");
Response.Write(Request.ServerVariables["Server_Port"].ToString() + "<br />");
Response.Write("<strong>本文件所在路径:</strong>");
Response.Write(Request.PhysicalApplicationPath + "<br />");
Response.Write("<strong>操作系统:</strong>");
Response.Write(Environment.OSVersion.ToString() + "<br />");
Response.Write("<strong>操作系统所在文件夹:</strong>");
Response.Write(Environment.SystemDirectory.ToString() + "<br />");
Response.Write("<strong>脚本超时时间:</strong>");
Response.Write((Server.ScriptTimeout / 1000).ToString() + "秒" + "<br />");
Response.Write("<strong>系统语言:</strong>");
Response.Write(CultureInfo.InstalledUICulture.EnglishName + "<br />");
Response.Write("<strong>.NET版本:</strong>");
Response.Write(string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, Environment.Version.Build, ".", Environment.Version.Revision }) + "<br />");
Response.Write("<strong>IE版本:</strong>");
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Version Vector");
Response.Write(key.GetValue("IE", "未检测到").ToString() + "<br />");
Response.Write("<strong>启动到现在已运行:</strong>");
Response.Write(((Environment.TickCount / 0x3e8) / 60).ToString() + "分钟" + "<br />");
Response.Write("<strong>逻辑驱动器:</strong>");
string[] achDrives = Directory.GetLogicalDrives();
for (int i = 0; i < Directory.GetLogicalDrives().Length - 1; i++)
{
Response.Write(achDrives[i].ToString());
}
Response.Write("<br />");
Response.Write("<strong>CPU 数量:</strong>");
Response.Write(Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString() + "<br />");
Response.Write("<strong>CPU类型:</strong>");
Response.Write(Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString() + "<br />");
Response.Write("<strong>ASP.NET所站内存:</strong>");
Response.Write(((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M" + "<br />");
Response.Write("<strong>ASP.NET所占CPU:</strong>");
Response.Write(((TimeSpan)Process.GetCurrentProcess().TotalProcessorTime).TotalSeconds.ToString("N0") + "%<br />");
Response.Write("<strong>当前系统用户名:</strong>");
Response.Write(Environment.UserName + "<br />");
%>
</p></P>
</form>
</body>
</html>
<%@ Page Language="C#"%>
<%@ Import Namespace="System.Globalization"%>
<%@ Import Namespace="Microsoft.Win32" %>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Diagnostics" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>asp.net 探针</title>
<link href="inc/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<br />
<p style=" text-align:left; margin-left:10px;">
<strong class="title">服务器探针</strong><P style=" text-align:left; margin-left:40px; line-height:22px;">
<%
Response.Write("<strong>计算机名:</strong>");
Response.Write("http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "<br />");
Response.Write("<strong>IP地址:</strong>");
Response.Write(Request.ServerVariables["LOCAl_ADDR"] + "<br />");
Response.Write("<strong>域名:</strong>");
Response.Write(Request.ServerVariables["SERVER_NAME"].ToString() + "<br />");
Response.Write("<strong>端口:</strong>");
Response.Write(Request.ServerVariables["Server_Port"].ToString() + "<br />");
Response.Write("<strong>本文件所在路径:</strong>");
Response.Write(Request.PhysicalApplicationPath + "<br />");
Response.Write("<strong>操作系统:</strong>");
Response.Write(Environment.OSVersion.ToString() + "<br />");
Response.Write("<strong>操作系统所在文件夹:</strong>");
Response.Write(Environment.SystemDirectory.ToString() + "<br />");
Response.Write("<strong>脚本超时时间:</strong>");
Response.Write((Server.ScriptTimeout / 1000).ToString() + "秒" + "<br />");
Response.Write("<strong>系统语言:</strong>");
Response.Write(CultureInfo.InstalledUICulture.EnglishName + "<br />");
Response.Write("<strong>.NET版本:</strong>");
Response.Write(string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, Environment.Version.Build, ".", Environment.Version.Revision }) + "<br />");
Response.Write("<strong>IE版本:</strong>");
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Version Vector");
Response.Write(key.GetValue("IE", "未检测到").ToString() + "<br />");
Response.Write("<strong>启动到现在已运行:</strong>");
Response.Write(((Environment.TickCount / 0x3e8) / 60).ToString() + "分钟" + "<br />");
Response.Write("<strong>逻辑驱动器:</strong>");
string[] achDrives = Directory.GetLogicalDrives();
for (int i = 0; i < Directory.GetLogicalDrives().Length - 1; i++)
{
Response.Write(achDrives[i].ToString());
}
Response.Write("<br />");
Response.Write("<strong>CPU 数量:</strong>");
Response.Write(Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString() + "<br />");
Response.Write("<strong>CPU类型:</strong>");
Response.Write(Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString() + "<br />");
Response.Write("<strong>ASP.NET所站内存:</strong>");
Response.Write(((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M" + "<br />");
Response.Write("<strong>ASP.NET所占CPU:</strong>");
Response.Write(((TimeSpan)Process.GetCurrentProcess().TotalProcessorTime).TotalSeconds.ToString("N0") + "%<br />");
Response.Write("<strong>当前系统用户名:</strong>");
Response.Write(Environment.UserName + "<br />");
%>
</p></P>
</form>
</body>
</html>