1 2 3 4 5 6 7 8 9 10 11 12
| ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = Environment.UserDomainName + "\\" + strAdmin;
oConn.Password = strPwd;
ManagementScope scope = new ManagementScope(@"\\" + lbPCName.Text + @"\root\default", oConn);
scope.Connect();
ManagementClass registry = new ManagementClass(scope, new ManagementPath("StdRegProv"), null);
if (is64bit)
{ strKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, lbPCName.Text).OpenSubKey(RegRunKey64); }
Ici - je reçois ce message "Requested registry access is not allowed." Je ne comprends rien.
else { strKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, lbPCName.Text).OpenSubKey(RegRunKey86); } |
Partager