ok what i was trying to do here is send the info to the label2.text and it just wont i was wondering if i was missing a piece of code or put it somewhere i shouldnt have idk here is the code
Code:
private void button7_Click(object sender, EventArgs e) { }
string GetProductId()
{
RegistryKey localMachine = null;
if (Environment.Is64BitOperatingSystem)
{
localMachine = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);
}
else
{
localMachine = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry32);
}
RegistryKey windowsNTKey = localMachine.OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion");
return windowsNTKey.GetValue("ProductId").ToString() ;
label2.Text = GetProductId();
}