[英]Encrypting Web.Config
以下是无需编程即可加密web.config文件的命令...
用于加密
aspnet_regiis -pef "Section" "Path exluding web.config"
对于解密
aspnet_regiis -pdf "Section" "Path exluding web.config"
通过此命令,您可以加密或解密所有部分。
在框架目录中使用aspnet_regiis工具:
-- CONFIGURATION ENCRYPTION OPTIONS --
pe section Encrypt the configuration section. Optional arguments:
[-prov provider] Use this provider to encrypt.
[-app virtual-path] Encrypt at this virtual path. Virtual path must begin with a forward slash.
If it is '/', then it refers to the root of the site. If -app is not specified, the root
web.config will be encrypted.
[-site site-name-or-ID] The site of the virtual path specified in -app. If not specified, the
default web site will be used.
[-location sub-path] Location sub path.
[-pkm] Encrypt/decrypt the machine.config instead of web.config.
pd section Decrypt the configuration section. Optional arguments:
[-app virtual-path] Decrypt at this virtual path. Virtual path must begin with a forward slash.
If it is '/', then it refers to the root of the site. If -app is not specified, the root
web.config will be decrypted.
[-site site-name-or-ID] The site of the virtual path specified in -app. If not specified, the
default web site will be used.
[-location sub-path] Location sub path.
[-pkm] Encrypt/decrypt the machine.config instead of web.config.
您应该从这里开始,易于理解,在MSDN中详细解释分步指南: 如何:使用DPAPI加密ASP.NET 2.0中的配置部分
使用aspnet_regiis.exe命令行工具
您还可以使用aspnet_regiis.exe命令行工具加密和解密Web.config文件中的部分,该工具可以在%WINDOWSDIR%\\ Microsoft.Net \\ Framework \\ version目录中找到。
请看这里: http : //aspnet.4guysfromrolla.com/articles/021506-1.aspx 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.