标题:怎么获取本机系统类别?
只看楼主
shuishenxian
Rank: 2
来 自:河南新乡
等 级:论坛游民
帖 子:40
专家分:64
注 册:2010-5-16
结帖率:83.33%
已结贴  问题点数:10 回复次数:2 
怎么获取本机系统类别?
一运行软件,在软件上会提示,本系统是xp还是win7?
搜索更多相关主题的帖子: 软件 
2011-11-28 23:02
jedypjd
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:9
帖 子:1096
专家分:4969
注 册:2009-7-27
得分:10 
     public string GetOperationSystemInName()
     {
         OperatingSystem os = System.Environment.OSVersion;
         string osName = "UNKNOWN";
         switch (os.Platform)
         {
             case PlatformID.Win32Windows:
                 switch (os.Version.Minor)
                 {
                     case 0: osName = "Windows 95"; break;
                     case 10: osName = "Windows 98"; break;
                     case 90: osName = "Windows ME"; break;
                 }
                 break;
             case PlatformID.Win32NT:
                 switch (os.Version.Major)
                 {
                     case 3: osName = "Windws NT 3.51"; break;
                     case 4: osName = "Windows NT 4"; break;
                     case 5: if (os.Version.Minor == 0)
                         {
                             osName = "Windows 2000";
                         }
                         else if (os.Version.Minor == 1)
                         {
                             osName = "Windows XP";
                         }
                         else if (os.Version.Minor == 2)
                         {
                             osName = "Windows Server 2003";
                         }
                         break;
                     case 6: osName = "Longhorn"; break;
                 }
                 break;
         }
         return String.Format("{0},{1}", osName, os.Version.ToString());
        }

天涯无岁月,歧路有风尘,百年浑似醉,是非一片云
2011-11-29 09:14
hoolly
Rank: 2
等 级:论坛游民
帖 子:11
专家分:15
注 册:2011-11-30
得分:0 
2011-11-30 11:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-356455-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097176 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved