This is a perfect situation where the System.Xml.Serialization
namespace comes into play. Using XML Serialization, you can
easily go from a class, to an XML file, and back again.
Before you can use it, however, you need to turn all your
variables into properties of a single class. Then you can just load
and save this class as needed.
You will most likely want to encrypt the values before saving, and
edcrypt them when you load them, as it is insanely easy to
change them just by opening up the XML file in notepad. This
encryption can be done with classes in the
System.Security.Cryptography namespace.
For information on XML Serialization:
[mshelp]ms-help://MS.VSCC/MS.MSDNVS/Cpqstart/html/cpsmpnetsamples-howtoxmlserialization.htm#cpsmpreadwritexmlsample[/mshelp]
[mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemxmlserializationxmlserializerclasstopic.htm[/mshelp]
And for info on encryption:
[mshelp]ms-help://MS.VSCC/MS.MSDNVS/Cpqstart/html/cpsmpnetsamples-howtocryptography.htm[/mshelp]
[mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemSecurityCryptography.htm[/mshelp]