[點晴永久免費OA]C#判斷操作系統(tǒng)類型
//C#判斷操作系統(tǒng)是否為Windows98 public bool IsWindows98 { get { return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() != "2222A"); } } //C#判斷操作系統(tǒng)是否為Windows98第二版 public bool IsWindows98Second { get { return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() == "2222A"); } } //C#判斷操作系統(tǒng)是否為Windows2000 public bool IsWindows2000 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 0); } } //C#判斷操作系統(tǒng)是否為WindowsXP public bool IsWindowsXP { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 1); } } //C#判斷操作系統(tǒng)是否為Windows2003 public bool IsWindows2003 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 2); } } //C#判斷操作系統(tǒng)是否為WindowsVista public bool IsWindowsVista { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 0); } } //C#判斷操作系統(tǒng)是否為Windows7 public bool IsWindows7 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 1); } } //C#判斷操作系統(tǒng)是否為Unix public bool IsUnix { get { return Environment.OSVersion.Platform == PlatformID.Unix; } } 該文章在 2017/4/21 1:00:51 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |