Exemplo n.º 1
0
 /// <summary>
 /// 解密connectionsetting里加密的字符串(根据配置IsEncryptConnectionString决定是否解密)
 /// </summary>
 /// <param name="connectionName"></param>
 /// <returns></returns>
 public static string ValueOfEncryptAppSettingString(this string settingKey)
 {
     return(DEncrypt.DecryptByConfig(
                System.Configuration.ConfigurationManager.AppSettings["IsEncryptConnectionString"],
                System.Configuration.ConfigurationManager.AppSettings[settingKey]
                ));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 根据配置决定是否解密某个连接字符串
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static string ValueOfDecryptString(this string str)
 {
     return(DEncrypt.DecryptByConfig(
                System.Configuration.ConfigurationManager.AppSettings["IsEncryptConnectionString"],
                str
                ));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 解密connectionsetting里加密的字符串(根据配置IsEncryptConnectionString决定是否解密)
 /// </summary>
 /// <param name="connectionName"></param>
 /// <returns></returns>
 public static string ValueOfEncryptConnectionString(this string connectionName)
 {
     return(DEncrypt.DecryptByConfig(
                System.Configuration.ConfigurationManager.AppSettings["IsEncryptConnectionString"],
                System.Configuration.ConfigurationManager.ConnectionStrings[connectionName].ConnectionString
                ));
 }