Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
QuestionUncommiteed SQLTransaction causing the problem Pin
atuldeore17-Apr-08 3:03
atuldeore17-Apr-08 3:03 
GeneralRe: Uncommiteed SQLTransaction causing the problem Pin
Reelix17-Apr-08 3:58
Reelix17-Apr-08 3:58 
GeneralRe: Uncommiteed SQLTransaction causing the problem Pin
atuldeore17-Apr-08 4:56
atuldeore17-Apr-08 4:56 
GeneralRegistryKey.OpenRemoteBaseKey() problem Pin
heidihund17-Apr-08 3:02
heidihund17-Apr-08 3:02 
GeneralRe: RegistryKey.OpenRemoteBaseKey() problem Pin
Ed.Poore17-Apr-08 4:39
Ed.Poore17-Apr-08 4:39 
GeneralRe: RegistryKey.OpenRemoteBaseKey() problem Pin
heidihund17-Apr-08 21:50
heidihund17-Apr-08 21:50 
GeneralRe: RegistryKey.OpenRemoteBaseKey() problem Pin
Ed.Poore17-Apr-08 23:07
Ed.Poore17-Apr-08 23:07 
AnswerRe: RegistryKey.OpenRemoteBaseKey() problem Pin
heidihund20-Apr-08 21:07
heidihund20-Apr-08 21:07 
I found a solution which is with not using OpenRemoteBaseKey(), and where you "log on" in a Connection before the change:

System.Management.ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "username";
oConn.Password = "pwd";
oConn.EnablePrivileges = true;
ManagementScope oMs = new ManagementScope(string.Format("\\\\{0}\\root\\default", MachineName), oConn);
oMs.Connect();
if (oMs.IsConnected) {
ManagementPath Path = new System.Management.ManagementPath("StdRegProv");
ManagementClass objClass = new System.Management.ManagementClass(oMs, Path, null);
ManagementBaseObject objInParams = objClass.GetMethodParameters("GetStringValue");
objInParams["hDefkey"] = LOCAL_MACHINE;
objInParams["sSubkeyName"] = KEY_NAME;
objInParams["sValueName"] = "NameOfRegKey";
ManagementBaseObject outParams = objClass.InvokeMethod("GetStringValue", objInParams, null);
objInParams = objClass.GetMethodParameters("SetStringValue");
objInParams["hDefkey"] = LOCAL_MACHINE;
objInParams["sSubkeyName"] = KEY_NAME;
objInParams["sValueName"] = "NameOfRegKey";
objInParams["sValue"] = "My value";
objClass.InvokeMethod("SetStringValue", objInParams, null);
}

Regards,
Heidi

heidihundala@gmail.com

GeneralRe: RegistryKey.OpenRemoteBaseKey() problem Pin
Dave Kreskowiak17-Apr-08 5:07
mveDave Kreskowiak17-Apr-08 5:07 
Generalmy game code Pin
stephen bempah17-Apr-08 2:42
stephen bempah17-Apr-08 2:42 
GeneralRe: my game code Pin
laserbaronen17-Apr-08 2:52
laserbaronen17-Apr-08 2:52 
GeneralRe: my game code Pin
Pete O'Hanlon17-Apr-08 3:01
mvePete O'Hanlon17-Apr-08 3:01 
GeneralRe: my game code Pin
Dave Kreskowiak17-Apr-08 5:03
mveDave Kreskowiak17-Apr-08 5:03 
GeneralMTOM Pin
JustRonald17-Apr-08 2:25
JustRonald17-Apr-08 2:25 
AnswerRe: MTOM Pin
atuldeore17-Apr-08 3:16
atuldeore17-Apr-08 3:16 
GeneralRe: MTOM Pin
JustRonald17-Apr-08 3:52
JustRonald17-Apr-08 3:52 
Generalexception in ReaderWriterLock Pin
George_George17-Apr-08 1:47
George_George17-Apr-08 1:47 
Generalapp.config wtf Pin
Razvan Dimescu17-Apr-08 1:00
Razvan Dimescu17-Apr-08 1:00 
GeneralRe: app.config wtf Pin
Ed.Poore17-Apr-08 1:13
Ed.Poore17-Apr-08 1:13 
GeneralRe: app.config wtf Pin
Razvan Dimescu17-Apr-08 6:46
Razvan Dimescu17-Apr-08 6:46 
GeneralRe: app.config wtf Pin
Ed.Poore17-Apr-08 11:35
Ed.Poore17-Apr-08 11:35 
Generalcrystall report! Pin
ali_reza_zareian17-Apr-08 0:19
ali_reza_zareian17-Apr-08 0:19 
QuestionHow to upload file onto server with credentials Pin
Chintan.Desai16-Apr-08 23:55
Chintan.Desai16-Apr-08 23:55 
AnswerRe: How to upload file onto server with credentials Pin
phannon8617-Apr-08 0:14
professionalphannon8617-Apr-08 0:14 
QuestionForm Layout at Runtime ? Pin
jamesjk16-Apr-08 23:33
jamesjk16-Apr-08 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.