Beispiel #1
0
        private void send_Click(object sender, EventArgs e)
        {
            if (address_textBox.Text == "" && amount_numericUpDown.Value == 0)
            {
                error_label.Text = "Please enter the fields!";
            }
            else
            {
                IDogecoinService DogecoinService = new DogecoinService();
                var a = DogecoinService.ValidateAddress(address_textBox.Text);
                Console.WriteLine(a);
                if (a.IsValid == true)
                {
                    if (amount_numericUpDown.Value <= DogecoinService.GetBalance())
                    {
                        var b = Convert.ToDecimal(amount_numericUpDown.Value);
                        DogecoinService.SendToAddress(address_textBox.Text, b, null, null);

                        error_label.Text = "Send Successfully!";
                    }
                    else
                    {
                        error_label.Text = "Please enter valid amount !";
                    }
                }
                else
                {
                    error_label.Text = "Please enter a valid address!";
                }
            }
        }
Beispiel #2
0
        private void recieve_comboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            IBitcoinService  bitcoinService  = new BitcoinService();
            ILitecoinService litecoinService = new LitecoinService();
            IDogecoinService dogecoinService = new DogecoinService();

            if (recieve_comboBox.Text == "Bitcoin")
            {
                recieve_unit_label.Text = "btc";
                var bitcoin_balance = bitcoinService.GetBalance();
                recieve_label.Text = bitcoin_balance.ToString("0.000000");
            }
            else if (recieve_comboBox.Text == "Bitcoin Cash")
            {
                recieve_unit_label.Text = "bch";
                var bitcoin_balance = bitcoinService.GetBalance();
                recieve_label.Text = bitcoin_balance.ToString("0.000000");
            }
            else if (recieve_comboBox.Text == "Litecoin")
            {
                recieve_unit_label.Text = "ltc";
                var litecoin_balance = litecoinService.GetBalance();
                recieve_label.Text = litecoin_balance.ToString("0.000000");
            }
            else if (recieve_comboBox.Text == "Dogecoin")
            {
                recieve_unit_label.Text = "doge";
                var dogecoin_balance = dogecoinService.GetBalance();
                recieve_label.Text = dogecoin_balance.ToString("0.000000");
            }
        }
        public recieve_dogecoin()
        {
            InitializeComponent();

            IDogecoinService dogecoinService = new DogecoinService();
            string           a = dogecoinService.GetNewAddress();

            address_textBox.Text = a;


            Gma.QrCodeNet.Encoding.QrEncoder Encoder = new Gma.QrCodeNet.Encoding.QrEncoder(Gma.QrCodeNet.Encoding.ErrorCorrectionLevel.H);
            Gma.QrCodeNet.Encoding.QrCode    Code    = Encoder.Encode(a);
            Bitmap TempBMP = new Bitmap(Code.Matrix.Width, Code.Matrix.Height);

            for (int X = 0; X <= (Code.Matrix.Width) - 1; X++)
            {
                for (int Y = 0; Y <= (Code.Matrix.Height) - 1; Y++)
                {
                    if (Code.Matrix.InternalArray[X, Y])
                    {
                        TempBMP.SetPixel(X, Y, System.Drawing.Color.Black);
                    }
                    else
                    {
                        TempBMP.SetPixel(X, Y, System.Drawing.Color.White);
                    }
                }
            }

            //TempBMP.Size abc = new System.Drawing.Size(120,120);

            //Console.Write(TempBMP);
            //ictureBox.Image.Size =new  Size(600, 700);
            //empBMP.Size = new Size(TempBMP.Height,TempBMP.Width);
            pictureBox.Size = new Size(100, 75);
            // pictureBox.Image = TempBMP;

            var imageTemp = new Bitmap(TempBMP);

            var image = new Bitmap(imageTemp, new System.Drawing.Size(new System.Drawing.Point(100, 75)));

            //image.Save("file.bmp", ImageFormat.Bmp);

            pictureBox.Image = image;
        }