c#
using (Microsoft.Win32.RegistryKey hklm = Microsoft.Win32.Registry.LocalMachine)
{
Microsoft.Win32.RegistryKey mydir = hklm.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion", true);
string value = mydir.GetValue("ProductId").ToString();
System.Console.WriteLine(value);
}
vb.net
Dim hklm As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
Dim mydir As Microsoft.Win32.RegistryKey = hklm.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion", True)
Dim value As String = mydir.GetValue("ProductId").ToString()
System.Console.WriteLine(value)
System.Console.Read()
好像在系统的哪个ini文件里,或者注册表。我的电脑属性里有,不过不知道有没有API调用出来。
看不到图.
bu zd a