public SqlInfo() { InitializeComponent(); Crypto crypto = new Crypto(); ConfigHandler ch = new ConfigHandler(); database.Text = ch.GetConfig("mysqlDatabase"); serveraddress.Text = ch.GetConfig("mysqlAddress"); password.Text = crypto.DecryptString(ch.GetConfig("mysqlPassword")); username.Text = ch.GetConfig("mysqlUsername"); Prefix.Text = ch.GetConfig("mysqlPrefix"); }
private void S3Info_Load(object sender, EventArgs e) { try { ConfigHandler ch = new ConfigHandler(); Crypto crypto = new Crypto(); serviceURL.Text = ch.GetConfig("S3url"); accessKey.Text = crypto.DecryptString(ch.GetConfig("S3accessKey")); secretKey.Text = crypto.DecryptString(ch.GetConfig("S3secretKey")); } catch { // ignored } }
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); }
public FtpInfo() { InitializeComponent(); String url = ""; String username = ""; String pass = ""; Crypto crypto = new Crypto(); try { ConfigHandler ch = new ConfigHandler(); url = ch.GetConfig("ftpUrl"); username = ch.GetConfig("ftpUserName"); pass = crypto.DecryptString(ch.GetConfig("ftpPassword")); } catch (Exception) { // ignored } Username.Text = username; Password.Text = pass; Host.Text = url; }
public Ftp() { Crypto crypto = new Crypto(); ConfigHandler ch = new ConfigHandler(); _url = ch.GetConfig("ftpUrl"); try { _password = crypto.DecryptString(ch.GetConfig("ftpPassword")); } catch (Exception) { _password = ""; } _userName = ch.GetConfig("ftpUserName"); if (_url.EndsWith("/")) { _url.Remove(_url.Length - 1); } if (!_url.StartsWith("ftp://")) { _url = "ftp://" + _url; } }
public S3() { ConfigHandler ch = new ConfigHandler(); Crypto crypto = new Crypto(); var accessKey = crypto.DecryptString(ch.GetConfig("S3accessKey")); var secretKey = crypto.DecryptString(ch.GetConfig("S3secretKey")); String url = ch.GetConfig("S3url"); _bucket = ch.GetConfig("S3Bucket"); var config = new AmazonS3Config {ServiceURL = url}; _client = AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey, config) as AmazonS3Client; }