public SolderSqlHandler()
 {
     Crypto crypto = new Crypto();
     ConfigHandler ch = new ConfigHandler();
     try
     {
         String s = ch.GetConfig("mysqlPassword");
         if (String.IsNullOrWhiteSpace(s))
         {
             ch.SetConfig("mysqlPassword", crypto.EncryptToString("password"));
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
         Debug.WriteLine(e.InnerException.ToString());
         ch.SetConfig("mysqlPassword", crypto.EncryptToString("password"));
     }
     var password = crypto.DecryptString(ch.GetConfig("mysqlPassword"));
     var username = ch.GetConfig("mysqlUsername");
     var address = ch.GetConfig("mysqlAddress");
     _database = ch.GetConfig("mysqlDatabase");
     _prefix = ch.GetConfig("mysqlPrefix");
     _connectionString = String.Format("address={0};username={1};password={2};database={3}", address, username, password, _database);
 }
Ejemplo n.º 2
0
        private void Acceptbutton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(Username.Text) || String.IsNullOrWhiteSpace(Password.Text) || String.IsNullOrWhiteSpace(Host.Text))
            {
                MessageBox.Show("Please fill out all values");
            }
            else
            {
                String url = Host.Text;
                if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
                {
                    Crypto crypto = new Crypto();
                    ConfigHandler ch = new ConfigHandler();
                    ch.SetConfig("ftpUserName", Username.Text);
                    ch.SetConfig("ftpUrl", url);
                    ch.SetConfig("ftpPassword", crypto.EncryptToString(Password.Text));
                    Close();
                }
                else
                {
                    MessageBox.Show("Hostname is not valid");
                }

            }
        }
Ejemplo n.º 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (IsEverythingFilledIn())
     {
         ConfigHandler ch = new ConfigHandler();
         Crypto crypto = new Crypto();
         ch.SetConfig("mysqlUsername", username.Text);
         ch.SetConfig("mysqlPassword", crypto.EncryptToString(password.Text));
         ch.SetConfig("mysqlAddress", serveraddress.Text);
         ch.SetConfig("mysqlDatabase", database.Text);
         ch.SetConfig("mysqlPrefix", Prefix.Text);
         Close();
     }
     else
     {
         MessageBox.Show("Please fill out all the data");
     }
 }
Ejemplo n.º 4
0
 private void Save_Click(object sender, EventArgs e)
 {
     if (IsEveryFilledIn())
     {
         if (buckets.SelectedItem != null)
         {
             String bucket = buckets.SelectedItem.ToString();
             ConfigHandler ch = new ConfigHandler();
             Crypto crypto = new Crypto();
             ch.SetConfig("S3url", serviceURL.Text);
             ch.SetConfig("S3accessKey", crypto.EncryptToString(accessKey.Text));
             ch.SetConfig("S3secretKey", crypto.EncryptToString(secretKey.Text));
             ch.SetConfig("S3Bucket", bucket);
             Close();
         }
         else
         {
             MessageBox.Show("Please select a bucket");
         }
     }
 }