We decided to use the registry for handling our deployment with connection strings in our VB.net application.
The requirements are:
- If the program cannot connect to the server, first check the registry for a connection string. IF not, create the folder and fill in the name, type, and data.
- Make sure its encrypted.
I have never edited or created anything in the registry. Where do I start? If anybody has any code samples or links to articles I would really appreciate it.
It looks like this tutorial would be a good source for the problem. I would strongly recommend against storing the connection string in the registry. It adds more work and more dependencies on the current operating environment. Additionally, configuration files are more portable and are better suited for storing property related information. If you use a settings file the supporting admins and your support people will thank you. [Compared to placing the information in the registry.
Totally agree with Steven here, but if you have to do it...here is some info From MSDN (link to all you need to know at the bottom). The following example reads, increments, and then writes a DWORD value to HKCU:
http://msdn.microsoft.com/en-us/library/aa289494%28VS.71%29.aspx