Serialization of Application Settings password

C

Curtis

I am using the application settings example @
http://msdn.microsoft.com/msdnmag/issues/05/04/AdvancedBasics/default.aspx .
My application needs to save a user name and password in encrypted format
into the XML settings file. I modified the settings.vb class to include code
that encrypts and decrypts the user name and password as needed. The problem
I am having is getting the username and password to store as encrypted in
the XML document. I have a public property that looks like this:

Public Property PWD() As String
Get
PWD = TextUnScramble(mPWD)
End Get
Set(ByVal Value As String)
mPWD = TextScramble(Value)
End Set
End Property

When I load the password back into my application the settings class
deserializes the information from the XML file so it consequently runs the
set method of my PWD property which then my app must call the Get of PWD to
get the actual value back into my application. The same situation occurs in
reverse when it serializes the information to the XML. When is the proper
time to run the methods I have defined as TextUnScramble and TextScramble. I
also want to be able to retrieve the information in the PWD property from my
app in decrypted format. Any help would be greatly appreciated.

Thanks,
Curtis
 
C

Curtis

I believe I solved my problem by making 2 Public Functions:

Public Function SetPWD(ByVal PWD As String)
mPWD = TextScramble(PWD)
End Function
Public Function GetPWD() As String
Return TextUnScramble(mPWD)
End Function

Thanks,
Curtis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top