예제 #1
0
 private void Decript_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtOriginal.Text.Trim()))
     {
         txtDecript.Text = WhfEncryption.DESDeCrypt(txtEncript.Text.Trim());
     }
 }
예제 #2
0
        public SqlDBBroker()
        {
            try
            {
                string        connectionString = "";
                ConfigManager cm = (ConfigManager)Thread.GetDomain().GetData("ConfigManager");

                if (cm == null)
                {
                    throw new Exception("Palau配置管理器未在启动时加载成功!");
                }
                //读取数据库连接字符串
                connectionString = cm["ConnectionString"].ToString();

                //进行字符串的解密(默认情况下连接字符串是加密的)
                connectionString = WhfEncryption.DESDeCrypt(connectionString);
                this.conn        = new SqlConnection(connectionString);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }