R
Ricardo Santos
I've got 2 solutions for your problem:
1st and the simplest:
RegistryPermission rpWrite = new
RegistryPermission(RegistryPermissionAccess.AllAccess,
@"HKEY_LOCAL_MACHINE\SOFTWARE\ODBC");
RegistryKey local =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, scMachine);
RegistryKey rkodbc = local.OpenSubKey("SOFTWARE", true);
and if you are in a diferent domain or not in a domain you can add a IPC
net use like this, where the path is @"\\MachineNameorIP\IPC$":
String cmdString = String.Format("net use {0} /user:{1}
{2}", path, username, password);
ManagementClass processClass = new
ManagementClass("Win32_Process");
object[] methodArgs = { cmdString, null, null, 0 };
object result = processClass.InvokeMethod("Create",
methodArgs);
1st and the simplest:
RegistryPermission rpWrite = new
RegistryPermission(RegistryPermissionAccess.AllAccess,
@"HKEY_LOCAL_MACHINE\SOFTWARE\ODBC");
RegistryKey local =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, scMachine);
RegistryKey rkodbc = local.OpenSubKey("SOFTWARE", true);
and if you are in a diferent domain or not in a domain you can add a IPC
net use like this, where the path is @"\\MachineNameorIP\IPC$":
String cmdString = String.Format("net use {0} /user:{1}
{2}", path, username, password);
ManagementClass processClass = new
ManagementClass("Win32_Process");
object[] methodArgs = { cmdString, null, null, 0 };
object result = processClass.InvokeMethod("Create",
methodArgs);