views:

89

answers:

1

when my.settings.datastorage has nothing in it, this works fine. but after i go through this twice, it gives me an error

total_string = "some string"
My.Settings.datastorage = My.Settings.datastorage & DPAPI.Encrypt(total_string)
My.Settings.Save()
MsgBox(DPAPI.Decrypt(My.Settings.datastorage))

this is the error it gives:

"Invalid character in a Base-64 string."

+2  A: 

You can't simply concatenate encrypted strings with &, not if you want to decode them later anyway. In order to Add information you'll have to decode what you've already got, combine the clear text en encode the total.

Henk Holterman
thank you very much!
I__