private async void btn_Add(object sender, RoutedEventArgs e) { if (!ECDH.Ins.CheckM() || !ECDH.Ins.CheckResult) { DialogueControl.ShowVerityECDH(this); } if (ECDH.Ins.CheckResult) { Result result = await ManagerControl.Ins.ToDo(EnumControl.AddAddress, this.label_Wif.Text.ToString()); this.Close(); await Task.Delay(500); DialogueControl.ShowAddressListDialogue(this.Owner); //if (result.msgCode == EnumMsgCode.AddAddressSuc) //{ // //} //else //{ // DialogueControl.ShowMessageDialogue(result.errorCode.ToString(), 2, this); //} } }
private void Btn_Add(object sender, RoutedEventArgs e) { // 使用一个IntPtr类型值来存储加密字符串的起始点 IntPtr p = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this.pwb_pw.SecurePassword); // 使用.NET内部算法把IntPtr指向处的字符集合转换成字符串 string password = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(p); if (string.IsNullOrEmpty(password)) { DialogueControl.ShowMessageDialogue("请输入密码", 2, this); return; } this.DialogResult = true; if (nep6wallet == null) { DialogueControl.ShowMessageDialogue("错误的钱包格式", 2, this); return; } if (!ECDH.Ins.CheckM() || !ECDH.Ins.CheckResult) { DialogueControl.ShowVerityECDH(this.Owner); } if (ECDH.Ins.CheckResult) { DialogueControl.ShowImportAddressListDialogue(nep6wallet, password, this.Owner); } }