Global variables

m3ckon

Member
Joined
Oct 6, 2005
Messages
5
Programming Experience
Beginner
Hi there,

I've manged to connect to my vpn using the wrapper pointed out to me before and am making good progress.

At the moment I store all of my program constants in an app.config file. However I want users to be able to enter some information and store it locally.

Now ideally I'd like to overwrite the app.config, but I've been told that this is either unacheivable or not good practise.

So can someone tell me the best way of doing this please...preferably with some pointers if possible?

Hope I'm not asking too much

M3ckon
 
Why not store it in registry???


Imports Microsoft.Win32

Public Reg As RegistryKey

'in form
Reg = Registry.LocalMachine.OpenSubKey("Software\\YourProgramName", True)
Reg.SetValue("ValueName", Value)
Reg.Close()

'to retrive value

Reg = Registry.LocalMachine.OpenSubKey("Software\\YourProgramName", False)
YourLocalVAriable = Reg.GetValue("ValueName")
Reg.Close()
 
Back
Top