日期:2014-05-17  浏览次数:20887 次

C# 判断当前系统是XP还是WIN7

直接提供Winform程序:

    OperatingSystem os = Environment.OSVersion;
            switch (os.Platform)
            {
                case PlatformID.Win32Windows:
                    switch (os.Version.Minor)
                    {
                        case 0:
                            label1.Text = "Windows   95 ";
                            break;
                        case 10:
                            if (os.Version.Revision.ToString() == "2222A ")
                                label1.Text