public static void doUserAndPassword() { string droneshareusername = MainV2.getConfig("droneshareusername"); InputBox.Show("Username", "Username", ref droneshareusername); MainV2.config["droneshareusername"] = droneshareusername; string dronesharepassword = MainV2.getConfig("dronesharepassword"); if (dronesharepassword != "") { try { // fail on bad entry var crypto = new Crypto(); dronesharepassword = crypto.DecryptString(dronesharepassword); } catch { } } InputBox.Show("Password", "Password", ref dronesharepassword, true); var crypto2 = new Crypto(); string encryptedpw = crypto2.EncryptString(dronesharepassword); MainV2.config["dronesharepassword"] = encryptedpw; }
public static void doUserAndPassword() { string droneshareusername = Settings.Instance["droneshareusername"]; InputBox.Show("Username", "Username", ref droneshareusername); Settings.Instance["droneshareusername"] = droneshareusername; string dronesharepassword = Settings.Instance["dronesharepassword"]; if (dronesharepassword != "") { try { // fail on bad entry var crypto = new Crypto(); dronesharepassword = crypto.DecryptString(dronesharepassword); } catch { } } InputBox.Show("Password", "Password", ref dronesharepassword, true); var crypto2 = new Crypto(); string encryptedpw = crypto2.EncryptString(dronesharepassword); Settings.Instance["dronesharepassword"] = encryptedpw; }