zoukankan      html  css  js  c++  java
  • 获取操作系统版本号

    代码:

     #region 获取操作系统版本号
    
            /// <summary>
            /// 获取操作系统版本号
            /// </summary>
            /// <returns></returns>
            public static string GetOSVersion()
            {
                //UserAgent 
                var userAgent = HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"];
    
                var osVersion = "未知";
    
                if (userAgent.Contains("NT 6.1"))
                {
                    osVersion = "Windows 7";
                }
                else if (userAgent.Contains("NT 6.0"))
                {
                    osVersion = "Windows Vista/Server 2008";
                }
                else if (userAgent.Contains("NT 5.2"))
                {
                    osVersion = "Windows Server 2003";
                }
                else if (userAgent.Contains("NT 5.1"))
                {
                    osVersion = "Windows XP";
                }
                else if (userAgent.Contains("NT 5"))
                {
                    osVersion = "Windows 2000";
                }
                else if (userAgent.Contains("NT 4"))
                {
                    osVersion = "Windows NT4";
                }
                else if (userAgent.Contains("Me"))
                {
                    osVersion = "Windows Me";
                }
                else if (userAgent.Contains("98"))
                {
                    osVersion = "Windows 98";
                }
                else if (userAgent.Contains("95"))
                {
                    osVersion = "Windows 95";
                }
                else if (userAgent.Contains("Mac"))
                {
                    osVersion = "Mac";
                }
                else if (userAgent.Contains("Unix"))
                {
                    osVersion = "UNIX";
                }
                else if (userAgent.Contains("Linux"))
                {
                    osVersion = "Linux";
                }
                else if (userAgent.Contains("SunOS"))
                {
                    osVersion = "SunOS";
                }
                return osVersion;
            }
            #endregion
  • 相关阅读:
    oracle触发器
    oracle存储函数
    ****Java程序调用存储过程****
    oracle储存过程--存储过程
    oracle储存过程--游标
    oracle存储过程--流程控制(条件判断和循环遍历)
    InterviewProblems
    RandomAccessFile浅析
    JSP基础——关于中文乱码问题
    基础数据结构——单链表
  • 原文地址:https://www.cnblogs.com/Tpf386/p/10001525.html
Copyright © 2011-2022 走看看