Encrypt ConnectionString App.Config trong C#

Theo: nguyenhaidang.name.vn | 10/01/2020 - 09:38

 You can easily apply the same solution as the web.config you just have to rename your app.config to web.config, encrypt with the aspnet_regiis tool and then rename it back to app.config.

  1. Rename app.config to web.config
  2. Open command prompt and type:
    %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" c:\<folder containing your web.config> (stop at folder level and don''t put the trailing "\")
  3. rename web.config back to app.config

You can open it in notepad to see the encrypted file. In visual studio you will see it''s decrypted. You can use your connection string the same way as if it was not encrypted.

Back Head Print
Tin khác

Search GridView with Paging on TextBox KeyPress using jQuery in ASP.Net    (28/07/2010)

Bootstrap AutoComplete TextBox example using jQuery TypeAhead plugin in ASP.Net with C# and VB.Net    (28/07/2010)

Disable Button and Submit button after one click using JavaScript and jQuery    (29/07/2010)

Split and convert Comma Separated (Delimited) String to Table in SQL Server    (01/09/2010)

Select Column values as Comma Separated (Delimited) string in SQL Server using COALESCE    (01/09/2010)