Tuesday, September 7, 2010

Use the tool aspnet_regiis.exe to encrypt and decrypt connection string in web.config

We place connection string in web.config like:

< ?xml version="1.0"?>
< configuration xmlns="http..... ">
< appSettings/>
< connectionStrings>

< connectionStrings/>
< system.web>
...
< /system.web>
< /configration>

We can use Visual Studio Command prompt to run the following command to encrypt and decrypt connection string in web.config:

aspnet_regiis -pef "connectionStrings" "C:\....\EncryptWebSite"

aspnet_regiis -pdf "connectionStrings" "C:\....\EncryptWebSite"

No comments: