Exemplo n.º 1
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            try
            {
                //cxnServidor = new TcpClient("127.0.0.1", 5432);
                cxnServidor = new TcpClient("pcgera", 5432);
                hcoms       = new HiloComs(txbUsuario, txbPassWord, cxnServidor);
                hcs         = new Thread(new ThreadStart(hcoms.cnnLogin));
                hcs.Start();
                hiloReg = new Thread(new ThreadStart(hilo_Regenera));
                hiloReg.Start();
            }
            catch (SocketException se)
            {
                this.Close();
                MessageBox.Show(se.ToString());
            }

            /*
             * DialogResult j = MessageBox.Show("En espera de cliente", "Situación", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
             * if (j == DialogResult.OK)
             *  MessageBox.Show("Aceptado");
             * else
             *  MessageBox.Show("Cancelado");
             */
        }
Exemplo n.º 2
0
 private void iniciarCliente()
 {
     try
     {
         roll   = "usuarios";
         usr    = Susr;
         colums = 4;
         inicializaVentana();
         SetupDataGridView();
         PopulateDataGridView("");
         actualiza();
         cxnServidor = new TcpClient("pcgera", 5432);
         hcoms       = new HiloComs(usr, dgv, cxnServidor);
         hcs         = new Thread(new ThreadStart(hcoms.cnnRetadores));
         hcs.Start();
         hcoms.accion = "LISTO@AJUGAR";
         hiloReg      = new Thread(new ThreadStart(hilo_LocalizaNumero));
         hiloReg.Start();
     }
     catch (SocketException se)
     {
         MessageBox.Show(se.ToString());
         this.Close();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.ToString());
         this.Close();
     }
 }
Exemplo n.º 3
0
 private void frmRegistro_Load(object sender, EventArgs e)
 {
     try
     {
         cxnServidor = new TcpClient("pcgera", 5432);
         hcoms       = new HiloComs(txbUsuario, txbPassWord, txbNombre, cxnServidor);
         hcs         = new Thread(new ThreadStart(hcoms.cnnRegistro));
         hcs.Start();
         hiloReg = new Thread(new ThreadStart(hilo_Regenera));
         hiloReg.Start();
     }
     catch (SocketException se)
     {
         this.Close();
         MessageBox.Show(se.ToString());
     }
 }