• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Asp.net服务器探针,Power by 51aspx.com

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
using System;using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;
using Microsoft.Win32;
using System.IO;
using System.Management;
using System.Diagnostics;


namespace ServerInfo
{
  /// <summary>
  /// Asp.net服务器探针,Power by 51aspx.com
  /// 作者liudao,51aspx.com版权所有 转载请保留版权信息
  /// </summary>
  public partial class _Default : System.Web.UI.Page
  {
  protected void Page_Load(object sender, EventArgs e)
  {
  if (!IsPostBack)
  {
  /// <summary>
  /// 取应用程序路径
  /// </summary>

  lbServerName.Text= "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
  lbIp.Text = Request.ServerVariables["LOCAl_ADDR"];
  lbDomain.Text = Request.ServerVariables["SERVER_NAME"].ToString();
  lbPort.Text = Request.ServerVariables["Server_Port"].ToString();
  lbIISVer.Text = Request.ServerVariables["Server_SoftWare"].ToString();
  lbPhPath.Text = Request.PhysicalApplicationPath;
  lbOperat.Text = Environment.OSVersion.ToString();
  lbSystemPath.Text = Environment.SystemDirectory.ToString();
  lbTimeOut.Text = (Server.ScriptTimeout/1000).ToString() + "秒";
  lbLan.Text = CultureInfo.InstalledUICulture.EnglishName;
  lbAspnetVer.Text = string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, Environment.Version.Build, ".", Environment.Version.Revision });
  lbCurrentTime.Text = DateTime.Now.ToString();
   
  RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Version Vector");
  lbIEVer.Text = key.GetValue("IE", "未检测到").ToString();
  lbServerLastStartToNow.Text = ((Environment.TickCount / 0x3e8)/60).ToString() + "分钟";

  string[] achDrives = Directory.GetLogicalDrives();
  for (int i = 0; i < Directory.GetLogicalDrives().Length - 1; i++)
  {
  lbLogicDriver.Text = lbLogicDriver.Text + achDrives[i].ToString();
  }

  //ManagementClass diskClass = new ManagementClass("NUMBER_OF_PROCESSORS");
  lbCpuNum.Text = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString();
  lbCpuType.Text = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString();
  lbMemory.Text = (Environment.WorkingSet / 1024).ToString()+ "M";
  lbMemoryPro.Text = ((Double)GC.GetTotalMemory(false) / 1048576).ToString("N2") + "M";
  lbMemoryNet.Text = ((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M";
  lbCpuNet.Text = ((TimeSpan)Process.GetCurrentProcess().TotalProcessorTime).TotalSeconds.ToString("N0");
  lbSessionNum.Text = Session.Contents.Count.ToString();
  lbSession.Text = Session.Contents.SessionID;
  lbUser.Text = Environment.UserName;

  }
  }
  }
}



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
IISWeb服务扩展中没有Asp.net2.0发布时间:2022-07-10
下一篇:
asp.net导出到Excel的最佳选择发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap