| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 641 人关注过本帖
标题:怎么获取本机系统类别?
只看楼主 加入收藏
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
快速回复:怎么获取本机系统类别?
数据加载中...
 
   



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

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