Exemple #1
0
        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);
            }
        }
        private void Click_Copy(object sender, RoutedEventArgs e)
        {
            var           listboxitem = ((sender as Button).Parent as Grid).Parent as ListBoxItem;
            var           address     = (listboxitem.FindName("address") as Label).Content;
            StringBuilder Copystr     = new StringBuilder();

            Copystr.Append(address.ToString());
            Clipboard.SetText(Copystr.ToString());

            DialogueControl.ShowMessageDialogue(Mgr_Language.Ins.Code2Word("$page_copysuc"), 1, this);
        }
Exemple #3
0
 private void Btn_OpenFile(object sender, RoutedEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
     ofd.Filter = "*.json|*.json";
     if (ofd.ShowDialog() == true)
     {
         try
         {
             this.label_path.Text = ofd.FileName;
             nep6wallet           = new ThinNeo.NEP6.NEP6Wallet(this.label_path.Text);
         }
         catch (Exception err)
         {
             DialogueControl.ShowMessageDialogue(err.ToString(), 2, this);
         }
     }
 }
        private async void Click_SetName(object sender, RoutedEventArgs e)
        {
            this.gif_loading.Visibility = Visibility.Visible;
            Button  setName = sender as Button;
            TextBox tb      = (setName.Parent as Grid).FindName("name") as TextBox;
            Label   lb      = (setName.Parent as Grid).FindName("address") as Label;
            var     name    = tb.Text;
            var     address = lb.Content.ToString();

            byte[] bytes_name = System.Text.Encoding.UTF8.GetBytes(name);

            //string result = await driverControl.SetName(address, bytes_name);
            Result result = await ManagerControl.Ins.ToDo(EnumControl.SetName, address, bytes_name);

            this.gif_loading.Visibility = Visibility.Hidden;
            setName.Focus();
            setName.Visibility = Visibility.Hidden;

            DialogueControl.ShowMessageDialogue(result.errorCode.ToString(), 2, this);
        }