I want to access few registry key like computer Owner name. And I did it, but it can't work in Windows7. It shows access is denied. My code is ...
using Microsoft.Win32;
....
try
{
string path = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion";
RegistryKey regkey = Registry.LocalMachine;
regkey = regkey.CreateSubKey(path);
string owner = (string)regkey.GetValue("RegisteredOwner");
string org = (string)regkey.GetValue("RegisteredOrganization");
label1.Text = "Computer owner: " + owner;
label2.Text = "Organisation" + org;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
plz help me!
Thank you in advance!
PLZ help me sir/mam, without your help this is not possable, & my work will rejected as it has showing exception in Windows 7. plz...
Loading

Tanmay SarkarPosted Jul 5, 2010, 1:42 AM
{
string a = Environment.MachineName;
string b = Environment.UserName;
string c = Environment.OSVersion.ToString();
string d = Environment.Version.ToString();
MessageBox.Show(a + "\n" + b + "\n" + c + "\n" + d);
}
it solve my problem but till I have a question.
Why we can't access the above registry path??
where is the mistake in my question's code section.
I want to learn it from you, please help me ....