zoukankan      html  css  js  c++  java
  • Web.Config加密

    Web.Config
    <configuration>
        <connectionStrings>
            <add name="ConnString" connectionString="Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />
        </connectionStrings>
    </configuration>


    The easiest way to encrypt the <connectionStrings> section is to use the aspnet_regiis command-line tool.
    This tool is located in the following folder:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\

    Executing the following command encrypts the <connectionStrings> section of a Web.Config file
    located in a folder with the path c:\Websites\MyWebsite:
       
        aspnet_regiis -pef connectionStrings "c:\Websites\MyWebsite"

    The -pef option (Protect Encrypt Filepath) encrypts a particular configuration section located at a particular path.

    You can decrypt a section with the -pdf option like this:
        aspnet_regiis -pdf connectionStrings "c:\Websites\MyWebsite"


    ASP.NET page can read the value of the connection string by using the <%$ ConnectionStrings:ConnString %> expression

    加密:

    在命令提示符下键入:

    aspnet_regiis -pef connectionStrings 要加密的web.config完整路经

    \

    解密:

     在命令提示符下键入:

    aspnet_regiis -pdf connectionStrings 要解密的web.config完整路经

    \

  • 相关阅读:
    time 时间模块的函数调用
    str 文本函数的调用
    批量分发公钥
    K8s集群部署(四)------ Flannel网络部署
    kuberbetes基础概念
    K8s集群部署(三)------ Node节点部署
    K8s集群部署(二)------ Master节点部署
    K8s集群部署(一)------ETCD集群部署
    日常更新脚本
    CentOS7系统安装
  • 原文地址:https://www.cnblogs.com/dodui/p/2157356.html
Copyright © 2011-2022 走看看