Tanmay Sarkar

Tanmay Sarkar

  • NA
  • 1.5k
  • 1m

Registry value can't access in Windows7 where it well work in XP

Jul 3 2010 10:27 AM
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...


Answers (1)