• asp.net获取服务器信息


    String serverOS = Environment.OSVersion.ToString();
    String CpuSum 
    = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS");// CPU个数:
    String CpuType = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER");// CPU类型:
    String ServerSoft = Request.ServerVariables["SERVER_SOFTWARE"]; // 信息服务软件:
    String MachineName = Server.MachineName;// 服务器名
    String ServerName = Request.ServerVariables["SERVER_NAME"];// 服务器域名
    String ServerPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];// 虚拟服务绝对路径
    String ServerNet = ".NET CLR " + Environment.Version.ToString(); // DotNET 版本
    String ServerArea = (DateTime.Now - DateTime.UtcNow).TotalHours > 0 ? "+" + (DateTime.Now - DateTime.UtcNow).TotalHours.ToString() : (DateTime.Now - DateTime.UtcNow).TotalHours.ToString();// 服务器时区
    String ServerTimeOut = Server.ScriptTimeout.ToString(); // 脚本超时时间
    String ServerStart = ((Double)System.Environment.TickCount / 3600000).ToString("N2");// 开机运行时长
    // AspNet CPU时间
    String ServerSessions = Session.Contents.Count.ToString();// Session总数
    String ServerApp = Application.Contents.Count.ToString(); // Application总数
    String ServerCache = Cache.Count.ToString(); //应用程序缓存总数
    // 应用程序占用内存
    //  String ServerFso = Check("Scripting.FileSystemObject");                // FSO 文本文件读写
    String ServerTimeOut = Server.ScriptTimeout.ToString() + "毫秒"// 本页执行时间 
  • 相关阅读:
    import和from .xxx import *的一点重要区别
    django 的时区设置
    更新项目,uwsgi重新加载和日志文件
    jQuery将json字符串显示在页面上
    远程访问rhel7的oracle中的问题
    ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务 的解决方法
    rhel7使用centos7yum组件
    spring AOP
    public protected default private权限修饰符理解
    用idea创建web项目
  • 原文地址:https://www.cnblogs.com/wyxy2005/p/1386499.html
Copyright © 2020-2023  润新知