Craig Yellick
asked on
Bind textbox to custom property in My.Settings
I need to store a complete set of database connection information in a utility app's settings file. Storing a password in clear text is not acceptable, but the user should not have to worry about that. I have the server, database and user name settings all bound to text controls as usual. When it comes to bind to the clear text password setting, it does not show up in the list (illustrated below).
Here's my customized settings class. The three code attributes are copied directly from the Settings.Designer.vb file generated for the other simple text settings. I would think this property would show up, but it does not. I re-compiled, closed Visual Studio, re-opened -- nothing.
If there is a better way to handle this I'm open, but the above is how it ought to work.
Here's my customized settings class. The three code attributes are copied directly from the Settings.Designer.vb file generated for the other simple text settings. I would think this property would show up, but it does not. I re-compiled, closed Visual Studio, re-opened -- nothing.
Namespace My
Partial Friend NotInheritable Class MySettings
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public Property Password As String
Get
Return Utility.Security.Decrypt(My.Settings.PasswordEncrypted)
End Get
Set(value As String)
My.Settings.PasswordEncrypted = Utility.Security.Encrypt(value)
End Set
End Property
End Class
End Namespace
If there is a better way to handle this I'm open, but the above is how it ought to work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window