Matt,
I wrote some code for this about 4 years ago.
Here the class that is saved to disk:
<Serializable()> Public Class StartUpValues
Public Server As String = "jfallon"
Public DataBase As String = "myDB"
Public Uid As String = "Joe"
<NonSerialized()> Public Pwd As String = "fallon"
Public ConnectionString As String = "someConnString"
Public DBtype As String = "SQL Server"
End Class
Here is how I saved it as a "fake" encrytped .dll file:
Private Sub SaveValues()Then in a Startup form load method I have code like this to decrypt the file and read it:
Private objStartUp As StartUpValuesobjStartUp = GetStartUpValues()
Public
Function GetStartUpValues() As StartUpValues
Joe
JoeFallon1:Matt,
I wrote some code for this about 4 years ago.
Here the class that is saved to disk:
Hi Joe Fallon,
I find this subject very interesting but my knowledge of VB is nil. I usually convert VB files to C# using SharpDevelop. But this only works if the VB source compiles all right. Using your post I made up the following files:
StartUpValues.vb
<Serializable()>
Public Class StartUpValuesStartupForm.vb
Imports
System.IOTIA
It is sample code.
There is no Crypto class in the .Net framework - it is one of my utility classes that uses the .Net version. You should probably comment it out.
The idea was simply to write the file to disk, call it a .dll in case someone was poking around and if they opened it they would see "junk".
If all you want to do is save and retrieve values you do not need encryption.
Joe
Copyright (c) Marimer LLC