private void BindAccount() { cboxAccount.Items.Clear(); DirectoryInfo folder = new DirectoryInfo(GlobalVar.keystore_path); var accounts = folder.GetFiles(); foreach (FileInfo file in accounts) { if (KeyStoreEx.IsRealAddress(file.Name)) { cboxAccount.Items.Add(file.Name); } } if (cboxAccount.Items.Count > 0) { cboxAccount.SelectedIndex = 0; } }
private void btnSubmit_Click(object sender, EventArgs e) { var pwd1 = txtPassword1.Text.Trim(); var pwd2 = txtPassword2.Text.Trim(); if (pwd1.Length < 8 || pwd2.Length < 8) { EasyMsg.ShowTips("密码长度不能小于8位!"); return; } if (pwd1 != pwd2) { EasyMsg.ShowTips("两次密码输入不一致!"); return; } string address = KeyStoreEx.GenerateKeyStore(pwd1, GlobalVar.keystore_path); FormMain main = (FormMain)this.Owner; main.AddNewAccount(address); this.Close(); }