cvboucher
Posts: 191
|
Posted: 10/30/2008, 11:58 AM |
|
I add the following code to the After Initialize event of my login page so the connection string will be encrypted. .Net automatically decrypts the conection string when it is needed.
Dim configFile As System.Configuration.Configuration
Dim configSection As ConfigurationSection
configFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
configSection = configFile.Sections("appSettings")
If Not configSection.SectionInformation.IsProtected() Then
configSection.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider")
configFile.Save()
End If
Craig
|