Click here to Skip to main content
15,915,703 members
Home / Discussions / C#
   

C#

 
GeneralImage resource management Pin
black02ep325-Nov-04 8:28
black02ep325-Nov-04 8:28 
GeneralRe: Image resource management Pin
Alex Korchemniy25-Nov-04 10:32
Alex Korchemniy25-Nov-04 10:32 
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 
I search the internet for few examples of accessing the registry and most of them were similar. One that I tried was as follows:


//add line
using Microsoft.Win32;

//open regitry
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey("SOFTWARE\\MyReg",true);

//create a sub key
OurKey = OurKey.OpenSubKey("SOFTWARE\\MyReg\\NewReg",true);
OurKey.CreateSubKey("NewKey");

Every thing works up to this points, but when I try to set some valuse for "NewReg" with following line, it still compiles w/no errors but I get an error when run the application

OurKey.SetValue("one","myVal");
or
//OurKey.SetValue("one",(string)"myVal");

ERROR:
Excepttion of type "System.NullReferenceException"
"Object not set to an instance of an object"
any help will be greatly appreciated
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 
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 

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.