Encrypt/Decrypt web.config

2019-09-07 07:36发布

问题:

I need to Encrypt the web.config file after publish it to the web server. The problem is, if I use asp_reg, I won't be read by the other machine/server. Does anyone have an idea how to do this? Some of my page is using SQLDataSource to read the connectionstring in the web.config file. Is this thing won't work if the web.config encrypted?

Thank you.

回答1:

SQLDataSource will work. Content of Web.config will be decrypted automatically by ASP.NET while processing this file.