私はC#を使用します。私は、OSの現在のバージョンを取得しよう:C#のWindows 10で現在のバージョンのOSを取得
OperatingSystem os = Environment.OSVersion;
Version ver = os.Version;
私はのWindows 10に乗る:6.2。
しかし6.2は、私は以下のソリューション(How can I detect if my app is running on Windows 10)を見つけのWindows 8かWindowsServer 2012(Detect Windows version in .net)
です。
static bool IsWindows10()
{
var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
string productName = (string)reg.GetValue("ProductName");
return productName.StartsWith("Windows 10");
}
これは、C#で、現在のバージョンを取得するための最良のの方法ですか?
この記事をチェックしてください:http://stackoverflow.com/questions/6331826/get-os-version-friendly-name-in-c-sharp –
@olgaマニフェスト+サポートされているOSのguidsを追加しましたか? – magicandre1981