private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         two.Text = ReversibleAlgorihm.DecryptStringAes(one.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
        public static string GetConnectionString(string key)
        {
            var appSettings = ConfigurationManager.AppSettings;
            var obj         = ConfigurationLoader.LoadByJson("db");

            if (obj == null)
            {
                throw new Exception("db.json has error");
            }
            var prex = "";

            if (appSettings["dev"] == "1")
            {
                prex = "dev_";
            }
            var connectionString = obj.GetValue(prex + key).ToString();

            connectionString = ReversibleAlgorihm.DecryptStringAes(connectionString);
            return(connectionString);
        }