使用aspnet_regiis.在命令行中浏览到(通常):
cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Run Code Online (Sandbox Code Playgroud)
并输入:
aspnet_regiis -pef "sectionName of web.config" "path" - to encrypt
aspnet_regiis -pdf "sectionName of web.config" "path" - to decrypt
Run Code Online (Sandbox Code Playgroud)
例如:
aspnet_regiis -pef "connectionStrings" "D:\projects\HelloWorldProject"
Run Code Online (Sandbox Code Playgroud)
您无需做任何事情来使L2SQL读取ecrypted连接字符串文件.