Exemple #1
0
 private void txtPwd_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (validaControles())
         {
             if (txtPwd.Text.Trim().Length >= 5)
             {
                 if (sPwdPlataforma != "")
                 {
                     login = new CAplicationLogin("", "", "", "", "");
                     string sPwdDec = login.Base64Decode(sPwdPlataforma);
                     if (txtPwd.Text.Trim() == sPwdDec)
                     {
                         txtapikey.Text  = login.Base64Decode(txtapikey.Text);
                         txtapipwd.Text  = login.Base64Decode(txtapipwd.Text);
                         bPasswordActivo = true;
                     }
                 }
             }
             else
             {
                 MessageBox.Show("El Password debe ser mayor o igual a 5 caracteres");
             }
         }// fin cboplataforma
     }
 }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            login       = new CAplicationLogin();
            sPlataforma = cboplataforma.SelectedItem.ToString();

            //if (validaControles())
            {
                //if (login.bitsoLogin())
                {
                    //lBalances = login.lBalances;

                    if (cboplataforma.SelectedItem.ToString().Trim() == "Bitso")
                    {
                        //login.guardarDatosApi_Bitso(txtapikey.Text.Trim(), txtapipwd.Text.Trim(), txtPwd.Text.Trim());
                        Bitso bitsoclient = new Bitso("JkkXaYKKDo", "578d14362dd2d68d05cb4dd0b2a92012", true);
                        if (bitsoclient.bitsoLogin())
                        {
                            //lBalances = bitsoclient.lBalance;
                            //lBalances.Add(
                            foreach (var val in bitsoclient.lBalance)
                            {
                                if (float.Parse(val.Total) > 0.0)
                                {
                                    lBalances.Add(new CBalance {
                                        currency = val.Currency, available = val.Available, locked = val.Locked, total = val.Total, pending_deposit = "0.0", pending_withdrawal = "0.0"
                                    });
                                }
                            }
                        }

                        //CTrading_Bitso bt = new CTrading_Bitso();
                        bitsoclient.consultaHistorialMonedas();
                        foreach (var mh in bitsoclient.lHistrialmoney)
                        {
                            this.lstHistrialmoney_login.Add(new CMonedaHistorial {
                                moneda = mh.moneda, valormin = mh.valormin, valormax = mh.valormax, tiempomin = mh.tiempomin, tiempomax = mh.tiempomax
                            });
                        }
                    }
                    if (txtapikey.Text.Trim() == "")
                    {
                        sApi_key = "JkkXaYKKDo";
                        sApi_pwd = "578d14362dd2d68d05cb4dd0b2a92012";
                    }
                    else
                    {
                        sApi_key = txtapikey.Text.Trim();
                        sApi_pwd = txtapipwd.Text.Trim();
                    }



                    this.Close();
                    DialogResult = DialogResult.OK;
                }
            }
        }
Exemple #3
0
        private bool leerconfiguaracionPlataforma(string sPlataforma)
        {
            bool   bRegresa = false;
            string sApikey = string.Empty, sApipwd = string.Empty, spwd = string.Empty;

            if (sPlataforma.Trim() == "Bitso")
            {
                login = new CAplicationLogin("", "", "", "", "");
                if (login.leeDatosApi_Bitso(ref sApikey, ref sApipwd, ref spwd))
                {
                    bRegresa = true;
                }
            }
            return(bRegresa);
        }