[英]How do I determine sub versions of Windows 7 programatically in C#?
I need to determine whether a machine is running Windows 7 Pro, or Windows 7 Embedded. 我需要确定计算机是否正在运行Windows 7 Pro或Windows 7 Embedded。 Environment.OSVersion returns the same version number on both systems, as does the Windows Management Interface. 与Windows管理界面一样,Environment.OSVersion在两个系统上都返回相同的版本号。 I'm looking at the Registry for some form of identifier, but I'm wondering if there is a solution I haven't considered yet. 我正在寻找注册表中的某种形式的标识符,但是我想知道是否有我尚未考虑的解决方案。
Run the above code to get the OS details: 运行以上代码以获取操作系统详细信息:
using System;
public class Example
{
public static void Main()
{
var os = Environment.OSVersion;
Console.WriteLine("Current OS Information:\n");
Console.WriteLine("Platform: {0:G}", os.Platform);
Console.WriteLine("Version String: {0}", os.VersionString);
Console.WriteLine("Version Information:");
Console.WriteLine(" Major: {0}", os.Version.Major);
Console.WriteLine(" Minor: {0}", os.Version.Minor);
Console.WriteLine("Service Pack: '{0}'", os.ServicePack);
Console.ReadKey();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.