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 = "无"; 
    }

  • 相关阅读:
    函数中,易遗忘记载
    常用函数源码
    装饰器之自我理解
    函数名、闭包及迭代器
    函数2
    trap(陷井)
    文件操作
    搭建Pxe引导RamOS Linux内存系统
    X86服务器BMC基板管理控制器介绍
    Linux操作系统自动部署--镜像格式qcow2
  • 原文地址:https://www.cnblogs.com/siyunianhua/p/10162867.html
Copyright © 2011-2022 走看看