zoukankan      html  css  js  c++  java
  • 获取服务器信息

    #region 获取服务器及用户信息 
    private void DataLoad() 

    DateTime sTime = DateTime.Now;

    ServerOS = Environment.OSVersion.ToString(); //操作系统: 
    CpuSum = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS"); //CPU个数: 
    CpuType = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"); //CPU类型: 
    ServerSoft = Request.ServerVariables["SERVER_SOFTWARE"]; //信息服务软件: 
    MachineName = Server.MachineName; //服务器名 
    ServerName = Request.ServerVariables["SERVER_NAME"]; //服务器域名 
    ServerPath = Request.ServerVariables["APPL_PHYSICAL_PATH"]; //虚拟服务绝对路径 
    ServerNet = ".NET CLR " + Environment.Version.ToString(); //DotNET 版本 
    ServerArea = (DateTime.Now - DateTime.UtcNow).TotalHours > 0 ? "+" + (DateTime.Now - DateTime.UtcNow).TotalHours.ToString() : (DateTime.Now - DateTime.UtcNow).TotalHours.ToString(); //服务器时区 
    ServerTimeOut = Server.ScriptTimeout.ToString(); //脚本超时时间 
    ServerStart = ((Double)System.Environment.TickCount / 3600000).ToString("N2"); //开机运行时长 
    PrStart = GetPrStart(); //进程开始时间 
    AspNetN = GetAspNetN(); //AspNet 内存占用 
    AspNetCpu = GetAspNetCpu(); //AspNet CPU时间 
    ServerSessions = Session.Contents.Count.ToString(); //Session总数 
    ServerApp = Application.Contents.Count.ToString(); //Application总数 
    ServerCache = Cache.Count.ToString(); //应用程序缓存总数 
    ServerAppN = GetServerAppN(); //应用程序占用内存 
    ServerFso = Check("Scripting.FileSystemObject"); //FSO 文本文件读写 
    ServerTimeOut = Server.ScriptTimeout.ToString() + "毫秒"; //本页执行时间 
    if (ServerSoft == "") 

    ServerSoft = "无"; 
    }

  • 相关阅读:
    oralce的function处理考勤时间节点以及计算工作时间
    如何把虚拟机上的文本或是文件复制粘贴到本地?
    Sqlserver语句对表结构的操作
    ubuntu下提示/boot空间不足,解决办法
    原码、反码和补码
    C++中四种类型转换方式
    C语言之 短路原则
    ubuntu下为opera26.0安装flash
    C++函数重载
    C++内联函数
  • 原文地址:https://www.cnblogs.com/siyunianhua/p/10162867.html
Copyright © 2011-2022 走看看