Recent Posts
Calendar
November 2013
S M T W T F S
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930

Posts Tagged ‘windows forms’

VB.NET Processing Before WinForm Display

arct-075

I woke up this morning to an interesting question.

“Using VB.net 2008, I want my project to be a Windows Forms Application, but upon startup, I want to check a few files to see if they exist and if they don’t I do not want the startup form to load. I just want the program to quit. If you have to start this type of application with a form, how do you keep the form from displaying?”

Read the rest of this entry »

UnauthorizedAccessException writing to HKLM

Q. I’m trying to write to HKLM on a Vista computer using the following code:

Dim k As Microsoft.Win32.RegistryKey
k = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("software", True)
k = k.CreateSubKey("subkey1\testprogram")
k.SetValue("foo", "bar")

But, when I get to the last line, the UnauthorizedAccessException is thrown.  How do I fix this?

Read the rest of this entry »