小编use*_*626的帖子

检查Windows名称c#

我将在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;
Run Code Online (Sandbox Code Playgroud)

c#

4
推荐指数
1
解决办法
803
查看次数

标签 统计

c# ×1