我将在 c# 中检查我的 Windows 操作系统名称(Windows 8 Pro),但它给出了一个错误,这是怎么回事?
RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion", true);
string currentKey;
currentKey = reg.GetValue("ProductName", true).ToString();
textBox1.Text = currentKey;