[点晴永久免费OA]C#判断操作系统类型
当前位置:点晴教程→点晴OA办公管理信息系统
→『 经验分享&问题答疑 』
//C#判断操作系统是否为Windows98 public bool IsWindows98 { get { return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() != "2222A"); } } //C#判断操作系统是否为Windows98第二版 public bool IsWindows98Second { get { return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() == "2222A"); } } //C#判断操作系统是否为Windows2000 public bool IsWindows2000 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 0); } } //C#判断操作系统是否为WindowsXP public bool IsWindowsXP { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 1); } } //C#判断操作系统是否为Windows2003 public bool IsWindows2003 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 2); } } //C#判断操作系统是否为WindowsVista public bool IsWindowsVista { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 0); } } //C#判断操作系统是否为Windows7 public bool IsWindows7 { get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 1); } } //C#判断操作系统是否为Unix public bool IsUnix { get { return Environment.OSVersion.Platform == PlatformID.Unix; } } 该文章在 2017/4/21 1:00:51 编辑过 |
关键字查询
相关文章
正在查询... |