Click here to Skip to main content
15,916,091 members
Home / Discussions / C#
   

C#

 
GeneralRe: Image resource management Pin
black02ep325-Nov-04 11:11
black02ep325-Nov-04 11:11 
GeneralXmlDataDocument problem Pin
QzRz25-Nov-04 8:14
QzRz25-Nov-04 8:14 
GeneralRe: XmlDataDocument problem Pin
Alex Korchemniy25-Nov-04 10:11
Alex Korchemniy25-Nov-04 10:11 
GeneralRe: XmlDataDocument problem Pin
QzRz26-Nov-04 2:14
QzRz26-Nov-04 2:14 
GeneralRe: XmlDataDocument problem Pin
Alex Korchemniy26-Nov-04 8:13
Alex Korchemniy26-Nov-04 8:13 
GeneralRegistry Pin
picasso225-Nov-04 8:02
picasso225-Nov-04 8:02 
GeneralRe: Registry Pin
Alex Korchemniy25-Nov-04 10:22
Alex Korchemniy25-Nov-04 10:22 
GeneralRe: Registry Pin
Robin Panther26-Nov-04 4:46
Robin Panther26-Nov-04 4:46 
This one is working fine:
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey("SOFTWARE\\",true);
//create a sub key
OurKey = OurKey.CreateSubKey("NewKey");
OurKey.SetValue("one","myVal");

OurKey is null when you are asking to open key, that does not exists. So - check this every time when opening a key - if return value is null, you have to create this key first.
One more thing - each key operation with registry (Open, Create etc.) has return value RegistryKey, so don't forget to assign your key to return value. In your example - when you're Creating SubKey - you do not have return value. That's you mistake.

Hope it'll help.

Robin Panther
GeneralWeb Browser Document event handling Pin
eliea25-Nov-04 7:27
eliea25-Nov-04 7:27 
GeneralRe: Web Browser Document event handling Pin
Alex Korchemniy25-Nov-04 10:43
Alex Korchemniy25-Nov-04 10:43 
GeneralRe: Web Browser Document event handling Pin
eliea25-Nov-04 19:45
eliea25-Nov-04 19:45 
GeneralRe: Web Browser Document event handling Pin
eliea26-Nov-04 22:06
eliea26-Nov-04 22:06 
GeneralRe: Web Browser Document event handling Pin
Alex Korchemniy27-Nov-04 9:51
Alex Korchemniy27-Nov-04 9:51 
GeneralRe: Web Browser Document event handling Pin
eliea29-Nov-04 1:07
eliea29-Nov-04 1:07 
GeneralRe: Web Browser Document event handling Pin
eliea29-Nov-04 8:06
eliea29-Nov-04 8:06 
Generaldirectx sdk Pin
cmarmr25-Nov-04 7:27
cmarmr25-Nov-04 7:27 
GeneralPagging dataset and rebind controls Pin
Kris{PL}25-Nov-04 5:09
Kris{PL}25-Nov-04 5:09 
GeneralHashtables and foreach loops: Pin
HahnTech25-Nov-04 4:42
HahnTech25-Nov-04 4:42 
GeneralRe: Hashtables and foreach loops: Pin
Daniel Grunwald25-Nov-04 6:31
Daniel Grunwald25-Nov-04 6:31 
GeneralRe: Hashtables and foreach loops: Pin
Luis Alonso Ramos25-Nov-04 10:52
Luis Alonso Ramos25-Nov-04 10:52 
GeneralRe: Hashtables and foreach loops: Pin
leppie25-Nov-04 20:49
leppie25-Nov-04 20:49 
GeneralRe: Hashtables and foreach loops: Pin
Luis Alonso Ramos26-Nov-04 5:28
Luis Alonso Ramos26-Nov-04 5:28 
GeneralRe: Hashtables and foreach loops: Pin
leppie26-Nov-04 5:40
leppie26-Nov-04 5:40 
GeneralExit Method Pin
lenchase25-Nov-04 4:01
lenchase25-Nov-04 4:01 
GeneralRe: Exit Method Pin
Stefan Troschuetz25-Nov-04 4:15
Stefan Troschuetz25-Nov-04 4:15 

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.