private string GetOperationSystemInformation() { System.OperatingSystem m_os = System.Environment.OSVersion; string m_osName = "Unknown"; switch(m_os.Platform) { case System.PlatformID.Win32Windows: switch(m_os.Version.Minor) { case 0: m_osName = "Windows 95"; break; case 10: m_osName = "Windows 98"; break; case 90: m_osName = "Windows ME"; break; } break; case System.PlatformID.Win32NT: switch(m_os.Version.Major) { case 3: m_osName = "Windws NT 3.51"; break; case 4: m_osName = "Windows NT 4"; break; case 5: if(m_os.Version.Minor == 0) m_osName = "Windows 2000"; else if(m_os.Version.Minor == 1) m_osName = "Windows XP"; else if(m_os.Version.Minor == 2) m_osName = "Windows Server 003"; break; case 6: m_osName = "Longhorn"; break; } break; } return m_osName + ", " + m_os.Version.ToString(); }
Get OS Name and Version
最新推荐文章于 2024-08-23 11:02:33 发布