Ejemplo n.º 1
0
 private void FrmLogin_Shown(Object sender, EventArgs e)
 {
     try
     {
         /////////////////////////////////////////////////////////
         if (blPr_YaActivada == false)
         {
             blPr_YaActivada = true;
             HallaListaServidores();
         }
         HabilitaBotones();
         // si tiene ue ocultar la forma con base en el valor de esta bandera
         // lo hace
         if (blPr_EscondeForma)
         {
             blPr_AceptoInformacion = false;
             // Cierra la forma
             this.Hide();
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         CmdCancelar.Enabled = true;
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin_Shown. System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CmdCancelar.Enabled = true;
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin_Shown. Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 2
0
        public String File2Des(String File2Des, String TieYMDown, String Chave2Olho, String KMAssH, String LicName, String File2Es3, String File2Es4, int MagicNumber)
        { //
            String stL_File2Des = "";

            try
            { // Inicio del Try
                //
                if (_st_Lic.Length == 0)
                {
                    MessageBox.Show("Invalid Lic To work");
                }
                return(stL_File2Des);
            } // Fin del Try
            catch (System.AccessViolationException ex_0)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "File2Des(4). System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
                return(stL_File2Des);
            }
            catch (Exception ex)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "File2Des(4)", "", ex.Message.ToString(), "", "");
                return(stL_File2Des);
            }
        }
Ejemplo n.º 3
0
 public CLNBTN_Protocol procesarES(String sentrada)
 {
     try
     {
         CLNBTN_Protocol sretorno = new CLNBTN_Protocol();
         if (sentrada.Contains("SA-SALIR"))
         {
             sretorno.comando = "SA-SALIR";
             sretorno.setParametros(quitarPalabra(sentrada, sretorno.comando));
         }
         else if (sentrada.Contains("SA-CONSULTA"))
         {
             sretorno.comando = "SA-CONSULTA";
             sretorno.setParametros(quitarPalabra(sentrada, sretorno.comando));
         }
         else if (sentrada.Contains("SA-LOGIN"))
         {
             sretorno.comando = "SA-LOGIN";
             sretorno.setParametros(quitarPalabra(sentrada, sretorno.comando));
         }
         return(sretorno);
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "procesarES. System.AccessViolationException", "", ex_0.Message.ToString());
         return(null);
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "procesarES. Exception", "", ex.Message.ToString());
         return(null);
     }
 }
Ejemplo n.º 4
0
        public String File2Es(String File2Es, String TieYMDown, String Chave2Olho, String KMAssH, String LicName)
        { //
            String stL_File2Es = "";

            try
            { // Inicio del Try
                //
                if (_st_Lic.Length == 0)
                {
                    MessageBox.Show("Invalid Lic To work");
                }
                else
                {
                    if (Chave2Olho.Trim() == "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=")
                    {
                        RijndaelManaged rijndaelCipher = new RijndaelManaged();
                        rijndaelCipher.Mode    = CipherMode.CBC;
                        rijndaelCipher.Padding = PaddingMode.PKCS7;
                        //
                        rijndaelCipher.KeySize   = 0x80;
                        rijndaelCipher.BlockSize = 0x80;
                        byte[] pwdBytes = Encoding.UTF8.GetBytes(CHAVE_ES);
                        byte[] keyBytes = new byte[0x10];
                        int    len      = pwdBytes.Length;
                        if (len > keyBytes.Length)
                        {
                            len = keyBytes.Length;
                        }
                        Array.Copy(pwdBytes, keyBytes, len);
                        rijndaelCipher.Key = keyBytes;
                        rijndaelCipher.IV  = keyBytes;
                        ICryptoTransform transform = rijndaelCipher.CreateEncryptor();
                        byte[]           plainText = Encoding.UTF8.GetBytes(File2Es);
                        stL_File2Es = Convert.ToBase64String(transform.TransformFinalBlock(plainText, 0, plainText.Length));
                    }
                }
                //
                return(stL_File2Es);
            } // Fin del Try
            catch (System.AccessViolationException ex_0)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "File2Es(1). System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
                return(stL_File2Es);
            }
            catch (Exception ex)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "File2Es(1)", "", ex.Message.ToString(), "", "");
                return(stL_File2Es);
            }
        }
Ejemplo n.º 5
0
        private void HabilitaBotones()
        {
            // Habilita los botones.
            try
            {
                //
                CmdAceptar.Enabled = false;
                //
                CmdCambiarClave.Enabled = false;
                //
                // Si los contenidos de los campos son diferentes a los textos originales.
                if (cmbServidores.Text != stPr_Servidor_Ori && TxtUsuario.Text != stPr_Usuario_Ori && TxtClave.Text != stPr_Clave_Ori)
                {
                    switch (ObjPr_InfoBD.get_DataBaseConn_Type())
                    { // Inicio del switch (ObjPr_InfoBD.getTipoConexion())
                    case CLNBTN_IQy.inConnect_Type.TYPE_3_CONNECT_USER_WIN:
                        // Usuario Windows es el mismo usuario de la base de datos
                        if ((cmbServidores.Text.Length > 0 && TxtUsuario.Text.Length > 0))
                        {
                            CmdAceptar.Enabled = true;
                            //
                            CmdCambiarClave.Enabled = true;
                        }
                        break;

                    default:
                        if ((cmbServidores.Text.Length > 0 && TxtUsuario.Text.Length > 0 && TxtClave.Text.Length > 0))
                        {
                            CmdAceptar.Enabled = true;
                            //
                            CmdCambiarClave.Enabled = true;
                        }
                        break;
                    } // fin del switch (ObjPr_InfoBD.getTipoConexion())
                }
                //
            }
            catch (System.AccessViolationException ex_0)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(4). System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(4). Exception", "", ex.Message.ToString());
            }
        }
Ejemplo n.º 6
0
        //

        public CLNBTN_Fm(String UserName, String LogFile, String LicName)
        {
            CLNBTN_Gp ObL_Lic = new CLNBTN_Gp(LicName);

            _st_Lic = ObL_Lic.getLicName();
            if (_st_Lic.Length == 0)
            {
                MessageBox.Show("Invalid Lic To work");
            }
            else
            {
                _st_User    = UserName;
                _st_FileLog = LogFile;
                //
                _Obj_Log = new CLNBTN_Lg(UserName, LogFile, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
            }
        }
Ejemplo n.º 7
0
 private void TxtClave2_TextChanged(object sender, EventArgs e)
 {
     try
     {
         HabilitaBotones();
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(6). System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(6). Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 8
0
 private void threadWait4Clients()
 {
     try
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " threadWait4Clients. Beginnig PANDORA Server On TCP Port :  [" + puerto.ToString() + "] ");
         Console.WriteLine("Beginnig PANDORA Server On TCP Port :  [" + puerto.ToString() + "] ");
         ipaddress   = IPAddress.Parse(direccionIP);
         tcplistener = new TcpListener(ipaddress, puerto);
         //tcplistener = new TcpListener(puerto);
         tcplistener.Start();
         //
         while (conectado)
         {
             objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " threadWait4Clients. Waiting for Client ...");
             Console.WriteLine("Waiting for Client ...");
             //
             socketCliente = tcplistener.AcceptSocket();
             //
             //Entrando un cliente
             objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " threadWait4Clients. Client Connected [" + socketCliente.RemoteEndPoint + "] ");
             Console.WriteLine("Client Connected [" + socketCliente.RemoteEndPoint + "] ");
             int llaveCliente = clientesConectados.Count;
             objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " threadWait4Clients. Key for Client [" + llaveCliente.ToString() + "] ");
             Console.WriteLine("Key for Client [" + llaveCliente.ToString() + "] ");
             //CLNBTN_FuncKrl o_cliente = new CLNBTN_FuncKrl(this,socketCliente,(clientesConectados.Count));
             CLNBTN_FuncKrl o_cliente = new CLNBTN_FuncKrl(_st_Lic, _st_User, _st_FileLog, this, socketCliente, (clientesConectados.Count));
             o_cliente.setObjetoParaSalida(this);
             clientesConectados.Add(o_cliente);
             clientesConectados[(clientesConectados.Count - 1)].setTimeout(timeout);
             clientesConectados[(clientesConectados.Count - 1)].start();
             //
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "threadWait4Clients. System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "threadWait4Clients. Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 9
0
 public void Want2Exit(CLNBTN_FuncKrl cliente)
 {
     try
     {
         cliente.Desconectar();
         clientesConectados.Remove(cliente);
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Want2Exit(1). System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Want2Exit(1). Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 10
0
 public int Wait4Client()
 {
     try {
         return(0);
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Wait4Client. System.AccessViolationException", "", ex_0.Message.ToString());
         return(-1);
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Wait4Client. Exception", "", ex.Message.ToString());
         return(-1);
     }
 }
Ejemplo n.º 11
0
 private void CmdCancelar_Click(object sender, EventArgs e)
 {
     try
     {
         blPr_AceptoInformacion = false;
         // Cierra la forma
         this.Hide();
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(3). System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(3). Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 12
0
 private void cmbServidores_SelectedIndexChanged_1(object sender, EventArgs e)
 {
     try
     {
         HabilitaBotones();
     }
     catch (System.AccessViolationException ex_0)
     {
         CmdCancelar.Enabled = true;
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(9). System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CmdCancelar.Enabled = true;
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(9). Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 13
0
 private void HabilitaBotones()
 {
     // Habilita los botones.
     try
     {
         //
         CmdAceptar.Enabled = false;
         //
         // Si los contenidos de los campos son diferentes a los textos originales.
         if (ObjPr_InfoBD.getUserApp_PWD().Length == 0)
         {
             if (TxtClave1.Text != stPr_Clave1_Ori && TxtClave2.Text != stPr_Clave2_Ori)
             {
                 if (TxtClave1.Text.Length > 0 && TxtClave2.Text.Length > 0)
                 {
                     CmdAceptar.Enabled = true;
                 }
             }
         }
         else
         {
             if (TxtClave.Text != stPr_Clave_Ori && TxtClave1.Text != stPr_Clave1_Ori && TxtClave2.Text != stPr_Clave2_Ori)
             {
                 if (TxtClave.Text.Length > 0 && TxtClave1.Text.Length > 0 && TxtClave2.Text.Length > 0)
                 {
                     CmdAceptar.Enabled = true;
                 }
             }
         }
         //
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(1). System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(1). Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 14
0
 public void start()
 {
     try
     {
         Thread t = new Thread(new ThreadStart(nucleoFunciones));
         t.Start();
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "start. System.AccessViolationException", "", ex_0.Message.ToString());
         mensajeError = ex_0.ToString();
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "start. Exception", "", ex.Message.ToString());
         mensajeError = ex.ToString();
     }
 }
Ejemplo n.º 15
0
 public void start()
 {
     try
     {
         Thread t = new Thread(new ThreadStart(threadWait4Clients));
         // Deja esta propiedad en true, para que cuando se cierre el programa
         // Tambien se termine la tarea.
         t.IsBackground = true;
         t.Start();
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "start. System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "start. Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 16
0
 public void BringBackParam(ref Boolean InfoIsAccepted, ref CLNBTN_IQy ObDbInfo)
 {
     // Devuelve los parametros
     try
     {
         //
         InfoIsAccepted = blPr_AceptoInformacion;
         // Devuelve el objeto con la informacion de la base de datos.
         ObDbInfo = ObjPr_InfoBD;
         //
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "BringBackParam. System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "BringBackParam. Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 17
0
 public void Desconectar()
 {
     try
     {
         if (socketCliente != null)
         {
             socketCliente.Close();
             socketCliente = null;
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Desconectar. System.AccessViolationException", "", ex_0.Message.ToString());
         mensajeError = ex_0.ToString();
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Desconectar. Exception", "", ex.Message.ToString());
         mensajeError = ex.ToString();
     }
 }
Ejemplo n.º 18
0
 public void x_respuestastcp(String quien, String[] datos)
 {
     try
     {
         this._st_Cedula = "";
         if (quien.Equals("SA-SALIR"))
         {
         }
         else if (quien.Equals("SA-CONSULTA"))
         {
             String cedula = datos[0];
             if (respuestaservidor == null)
             {
                 this._st_Cedula = cedula;
             }
             else
             {
                 respuestaservidor.x_mensajesservidor(datos);
             }
         }
         else if (quien.Equals("SA-LOGIN"))
         {
             String token = datos[0];
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "x_respuestastcp. System.AccessViolationException", "", ex_0.Message.ToString());
     }
     catch (Exception ex)
     {
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "x_respuestastcp. Exception", "", ex.Message.ToString());
     }
 }
Ejemplo n.º 19
0
 public void WriteTextInLog(String InfoText)
 {
     _st_Line1       = "";
     _st_Line2       = "";
     _st_Line3       = "";
     _st_Line4       = "";
     _st_Line5       = "";
     _st_Line6       = "";
     _st_Line7       = "";
     _st_Mess2Window = "";
     try
     {
         _st_Line1 = "*******************************************************************************";
         _st_Line2 = DateTime.Now.ToString();
         _st_Line3 = InfoText;
         //
         if (_bl_OutFileLog == true)
         {
             // esta parte debe ser hecha con un thread. validando que el archivo este libre para poder escribirlo.
             if (_bl_Write2Thread)
             {
                 Thread Hilo = new Thread(this.Write_2_Log);
                 Hilo.Start();
             }
             else
             {
                 this.Write_2_Log();
             }
             //
         }
         //
         if (_bl_OutLineConsole == true)
         {
             Console.WriteLine(_st_Line1);
             Console.WriteLine(_st_Line2);
             Console.WriteLine(_st_Line3);
             //Console.ReadLine();
         }
         //
         if (_bl_OutWindow == true)
         {
             _st_Mess2Window = InfoText;
             //ClasX_Utils ShowDialog = new ClasX_Utils();
             //ShowDialog.ShowMessage(MENSAJE_3, InfoText, MENSAJE_4);
         }
     }
     catch (System.AccessViolationException ex_0)
     {
         //
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
         //
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "WriteTextInLog. System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
         //
     }
     catch (Exception ex)
     {
         //
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
         //
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "WriteTextInLog", "", ex.Message.ToString(), "", "");
         //
     }
 }
Ejemplo n.º 20
0
        private void nucleoFunciones()
        {
            try
            {
                //Crear buffer de lectura y escritura
                networkStream = new NetworkStream(socketCliente);
                streamWriter  = new StreamWriter(networkStream);
                streamReader  = new StreamReader(networkStream);
                String cadenaEntrada = "";
                //
                CLNBTN_Protocol protocolo = new CLNBTN_Protocol();
                s_ipcliente = socketCliente.RemoteEndPoint.ToString();
                //
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " FuncKernel. SRV-PANDORA Index[ " + mi_llave.ToString() + " ] IP[ " + s_ipcliente + " ] ");
                //-->>streamWriter.WriteLine("SRV-PANDORA Index[ "+mi_llave.ToString()+" ] IP[ " +s_ipcliente+ " ] ");
                streamWriter.Flush();
                //
                while (true)
                {
                    cadenaEntrada = streamReader.ReadLine();
                    objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " FuncKernel. Input Command From : " + s_ipcliente + " : " + cadenaEntrada);
                    Console.WriteLine("Input Command From : " + s_ipcliente + " : " + cadenaEntrada);
                    protocolo = procesarES(cadenaEntrada);

                    if (protocolo.comando.Contains("SA-SALIR"))
                    {
                        protocolo.respuesta = "SA-SALIR " + mi_llave.ToString();
                        break;
                    }
                    else if (protocolo.comando.Contains("SA-CONSULTA"))
                    {
                        try
                        {
                            if (protocolo.listaparametros.Length > 1)
                            {
                                String cedula = protocolo.listaparametros[0].Trim();

                                String[] datos = new String[1];
                                datos[0] = cedula;
                                ifaz_respuestatcp.x_respuestastcp("SA-CONSULTA", datos);
                                protocolo.respuesta = "SA-CONSULTA " + cedula;
                            }
                            else
                            {
                                protocolo.respuesta = "SA-CONSULTA ERROR " + "Los parametros no son correctos";
                            }
                        }catch (Exception e) {
                            protocolo.respuesta = "SA-CONSULTA ERROR " + e.ToString();
                        }
                    }
                    else if (protocolo.comando.Contains("SA-LOGIN"))
                    {
                        try
                        {
                            if (protocolo.listaparametros.Length > 1)
                            {
                                String usuario = protocolo.listaparametros[0];
                                String clave   = protocolo.listaparametros[1];
                                protocolo.respuesta = "SA-LOGIN " + "90053737892015";
                                String[] datos = new String[3];
                                datos[0] = "90053737892015";
                                datos[1] = usuario;
                                datos[2] = clave;
                                ifaz_respuestatcp.x_respuestastcp("SA-LOGIN", datos);
                            }
                            else
                            {
                                protocolo.respuesta = "SA-LOGIN ERROR " + "Los parametros no son correctos";
                            }
                        }
                        catch (Exception e)
                        {
                            protocolo.respuesta = "SA-LOGIN ERROR " + e.ToString();
                        }
                    }
                    else
                    {
                        protocolo.respuesta = "SRV-PANDORA Terminando Conexion ...";
                    }
                    //Escribiendo la salida
                    if (protocolo.respuesta.Length > 0)
                    {
                        objL_Log.WriteTextInLog(_st_Relac + " " + _st_RelacSon + " FuncKernel. Sending response to : " + s_ipcliente + " : " + protocolo.respuesta);
                        //-->>Console.Write("Enviando respuesta a : " + s_ipcliente + " : " + protocolo.respuesta);
                        streamWriter.WriteLine(protocolo.respuesta);
                        streamWriter.Flush();
                        break;
                    }
                }
                Desconectar();
                servidortcp.Want2Exit(this);
                //
            }
            catch (System.AccessViolationException ex_0)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "nucleoFunciones. System.AccessViolationException", "", ex_0.Message.ToString());
                mensajeError = ex_0.ToString();
            }
            catch (Exception ex)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "nucleoFunciones. Exception", "", ex.Message.ToString());
                mensajeError = ex.ToString();
            }
        }
Ejemplo n.º 21
0
        private void CmdCambiarClave_Click(object sender, EventArgs e)
        {
            CLNBTN_Qy Query                = null;
            CLNBTN_Sg ObjL_Secur           = null;
            Boolean   blL_Conectar         = true;
            Boolean   blL_AceptoDatos      = false;
            Boolean   blL_Se_Conecto       = false;
            String    stL_MensajeValidaUso = "";
            Boolean   blL_PideCambioClave  = false;
            Boolean   blL_Definio_Servidor = false;

            try
            {
                //
                LblMensaje.Text  = "";
                inPr_NumIntentos = inPr_NumIntentos + 1;
                if (inPr_NumIntentos > MAX_INTENTOS)
                {
                    LblMensaje.Text = MENSAJE_3;
                }
                else
                {
                    // Asigna informacion
                    Query = new CLNBTN_Qy(_st_User, _st_FileLog, _st_Lic);
                    //
                    ObjPr_InfoBD.setServerName(cmbServidores.Text);
                    ObjL_Secur = new CLNBTN_Sg(_st_User, _st_FileLog, stPr_ArchivoConfigApp, stPr_Nombre_App, stPr_Version_App, stPr_NombreEmpresa_App, stPr_Archivo_InfoBds, stPr_NombreBd_XTrabajo, _st_Lic);
                    ObjL_Secur.Is_A_Valid_DB_Conn(ref blL_Definio_Servidor, ref blL_Conectar, ref blL_Se_Conecto, ref ObjPr_InfoBD, ObjPr_Conf, TxtUsuario.Text, TxtClave.Text, stPr_Seccion_BaseDeDatos);
                    //
                    if (blL_Definio_Servidor)
                    {
                        // Si definio el servidor lo coloca en la lista y deshabilita el combobox
                        List <String> LstServidores = new List <String>();
                        // Asigna el Servior, que tiene la BD
                        LstServidores.Add(ObjPr_InfoBD.getServerName());
                        this.cmbServidores.DataSource = LstServidores;
                        cmbServidores.Enabled         = false;
                    }
                    //
                    // Hace la conexion
                    Query.setDataBaseInfo(ObjPr_InfoBD);
                    if (blL_Conectar)
                    { // del if (blL_Conectar)
                        Query.ConnectDataBase();
                        //
                        if (Query.getIs_Connected())
                        {
                            blL_Se_Conecto = true;
                        }
                    } // del if (blL_Conectar)
                    //
                    if (blL_Se_Conecto)
                    {
                        // Valida el usuario
                        ObjL_Secur = new CLNBTN_Sg(_st_User, _st_FileLog, stPr_ArchivoConfigApp, stPr_Nombre_App, stPr_Version_App, stPr_NombreEmpresa_App, stPr_Archivo_InfoBds, stPr_NombreBd_XTrabajo, _st_Lic);
                        //
                        ObjL_Secur.Is_A_Valid_User_Access(ref blL_AceptoDatos, ref stL_MensajeValidaUso, ref blL_PideCambioClave, ref ObjPr_InfoBD, true);
                        //
                        // Presenta el mensaje del usuario
                        LblMensaje.Text = stL_MensajeValidaUso;
                        //
                        if (blL_PideCambioClave)
                        {
                            // Presenta ventana para cambio de clave
                            //
                            ObjL_Secur.Let_ShowFrmChPwd(ref blL_AceptoDatos, ref ObjPr_InfoBD);
                            if (blL_AceptoDatos)
                            {
                                blPr_AceptoInformacion = true;
                                // Cierra la forma
                                this.Hide();
                            }
                        }
                        else
                        {
                            if (blL_AceptoDatos)
                            {
                                blPr_AceptoInformacion = true;
                                // Cierra la forma
                                this.Hide();
                            }
                        }
                    }
                }
            }
            catch (System.AccessViolationException ex_0)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(10). System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(10). Exception", "", ex.Message.ToString());
            }
        }
Ejemplo n.º 22
0
        private void CmdAceptar_Click(object sender, EventArgs e)
        {
            CLNBTN_Qy Query           = null;
            CLNBTN_Es Encrip          = new CLNBTN_Es(_st_User, _st_FileLog, _st_Lic);
            CLNBTN_Ul Utils           = new CLNBTN_Ul(_st_User, _st_FileLog, _st_Lic);
            Boolean   blL_ValidaClave = false;
            String    stL_Encrip      = "";
            int       inL_DiasClave   = 0;

            try
            {
                //
                LblMensaje.Text  = "";
                inPr_NumIntentos = inPr_NumIntentos + 1;
                if (inPr_NumIntentos > MAX_INTENTOS)
                {
                    LblMensaje.Text = MENSAJE_3;
                }
                else
                {
                    //
                    switch (ObjPr_InfoBD.get_DataBaseConn_Type())
                    {
                    case CLNBTN_IQy.inConnect_Type.TYPE_1_CONNECT_USER_SQL:
                        //
                        blL_ValidaClave = true;
                        break;

                    case CLNBTN_IQy.inConnect_Type.TYPE_4_CONNECT_USER_INFO_EXT:
                        //
                        blL_ValidaClave = true;
                        break;
                    }
                    if (blL_ValidaClave)
                    { // del if ( blL_ValidaClave )
                        // Asigna informacion
                        Query = new CLNBTN_Qy(_st_User, _st_FileLog, _st_Lic);
                        //
                        // Hace la conexion
                        Query.setDataBaseInfo(ObjPr_InfoBD);
                        Query.ConnectDataBase();
                        //
                        if (Query.getIs_Connected())
                        {
                            blL_ValidaClave = false;
                            if (ObjPr_InfoBD.getUserApp_PWD().Length == 0)
                            {
                                blL_ValidaClave = true;
                            }
                            else
                            {
                                if (ObjPr_InfoBD.getUserApp_PWD() == TxtClave.Text)
                                {
                                    blL_ValidaClave = true;
                                }
                                else
                                {
                                    LblMensaje.Text = MENSAJE_18;
                                }
                            }
                            if (blL_ValidaClave)
                            {
                                blL_ValidaClave = false;
                                if (TxtClave1.Text == TxtClave2.Text)
                                {
                                    if (TxtClave.Text == TxtClave1.Text)
                                    {
                                        LblMensaje.Text = MENSAJE_20;
                                    }
                                    else
                                    {
                                        blL_ValidaClave = true;
                                    }
                                }
                                else
                                {
                                    LblMensaje.Text = MENSAJE_19;
                                }
                            }
                            if (blL_ValidaClave)
                            {
                                // Define DataTable, para los Datos del Query
                                DataTable DatTable = null;
                                //
                                Query.ToDo_SELECT("*");
                                Query.ToDo_FROM("t00usuarios");
                                Query.ToDo_WHERE("A00USUARIOWIN", "'" + ObjPr_InfoBD.getUser() + "'");
                                Query.ToDo_EXECUTE_SQL(ref DatTable);
                                if (DatTable != null)
                                { // del if (Query.Rs.State != 0)
                                    for (int inL_Row = 0; inL_Row < DatTable.Rows.Count; inL_Row++)
                                    {
                                        // Toma la informacion de la fila
                                        DataRow Info_Fila = DatTable.Rows[inL_Row];
                                        inL_DiasClave = 0;
                                        //if (!DBNull.Value.Equals(Info_Fila["A00DIAS_CLAVE"].ToString()))
                                        //{
                                        if (Info_Fila["A00DIAS_CLAVE"].ToString().Length > 0)
                                        {
                                            inL_DiasClave = Convert.ToInt16(Info_Fila["A00DIAS_CLAVE"].ToString());
                                        }
                                        //}
                                    }
                                }
                                Query.ToDo_CLOSE();
                                //
                                stL_Encrip = Encrip.File2Es(TxtClave1.Text.Trim(), "", "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=", "", _st_Lic);
                                Query.ToDo_UPDATE("t00usuarios");
                                Query.ToDo_SET("A00ESTADO", ESTADO_ACTIVO);
                                Query.ToDo_SET("A00CLAVE", stL_Encrip);
                                Query.ToDo_SET("A00FECHA_CLAVE", Utils.BringMeServerDate(ObjPr_InfoBD, true));
                                if (inL_DiasClave == 0)
                                {
                                    Query.ToDo_SET("A00DIAS_CLAVE", "30");
                                }
                                Query.ToDo_WHERE("A00USUARIOWIN", " '" + ObjPr_InfoBD.getUser() + "' ");
                                Query.ToDo_EXECUTE_SQL();
                                if (Query.getSuccessQueryExecution())
                                {
                                    ObjPr_InfoBD.setUserApp_PWD(TxtClave1.Text);
                                    ObjPr_InfoBD.setUserApp_PWD_Enc(stL_Encrip);
                                    MessageBox.Show(MENSAJE_21, MENSAJE_5);
                                }
                                Query.ToDo_CLOSE();
                                //
                                blPr_AceptoInformacion = true;
                                // Cierra la forma
                                this.Hide();
                            }
                        }
                    } // del if ( blL_ValidaClave )
                }
            }
            catch (System.AccessViolationException ex_0)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(2). System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmChgPwd(2). Exception", "", ex.Message.ToString());
            }
        }
Ejemplo n.º 23
0
        private void HallaListaServidores()
        {
            // Halla la lista de los servidores de SQL Server.
            // URL de consulta : http://programandoenpuntonet.blogspot.com/2009/01/obtener-instancias-de-sql-server-y.html
            // Creamos una lista para que sea el origen de datos del combobox
            List <String> LstServidores     = new List <String>();
            Boolean       blL_EstadoCombo   = false;
            Boolean       blL_EstadoUsuario = false;
            Boolean       blL_EstacoClave   = false;
            //
            CLNBTN_Qy Query                = null;
            CLNBTN_Sg ObjL_Secur           = null;
            Boolean   blL_Conectar         = true;
            Boolean   blL_Se_Conecto       = false;
            Boolean   blL_Definio_Servidor = false;

            //
            try
            {
                // Guarda los estados de los controles
                blL_EstadoCombo   = cmbServidores.Enabled;
                blL_EstadoUsuario = TxtUsuario.Enabled;
                blL_EstacoClave   = TxtClave.Enabled;
                // Los Coloca en false, mientras halla la lista de los servidores
                cmbServidores.Enabled = false;
                TxtUsuario.Enabled    = false;
                TxtClave.Enabled      = false;
                CmdCancelar.Enabled   = false;
                //
                LblMensaje.Text = MENSAJE_23 + NEW_LINE + MENSAJE_24;
                Application.DoEvents();
                Application.DoEvents();
                //
                if (ObjPr_InfoBD.getDataBaseEngine_Type() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                { // del if (ObjPr_InfoBD.getTipoBD() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                    //
                    if (ObjPr_InfoBD.get_DataBaseConn_Type() == CLNBTN_IQy.inConnect_Type.TYPE_4_CONNECT_USER_INFO_EXT)
                    {
                        if (blPr_ServidorYaDefinido)
                        { // Inicio del if (blPr_ServidorYaDefinido)
                            // Asigna el Servior, que tiene la BD
                            if (ObjPr_InfoBD.getServerName().Length > 0)
                            {
                                LstServidores.Add(ObjPr_InfoBD.getServerName());
                                this.cmbServidores.DataSource = LstServidores;
                                //this.cmbServidores.Enabled = false;
                                blL_EstadoCombo = false;
                            }
                        }    // fin del if (blPr_ServidorYaDefinido)
                        else // del if (blPr_ServidorYaDefinido)
                        { // Inicio del else if (blPr_ServidorYaDefinido)
                            // Prueba Conexion
                            LblMensaje.Text = MENSAJE_25 + NEW_LINE + MENSAJE_24;
                            Application.DoEvents();
                            // Asigna informacion
                            Query = new CLNBTN_Qy(_st_User, _st_FileLog, _st_Lic);
                            //
                            ObjPr_InfoBD.setServerName(cmbServidores.Text);
                            ObjL_Secur = new CLNBTN_Sg(_st_User, _st_FileLog, stPr_ArchivoConfigApp, stPr_Nombre_App, stPr_Version_App, stPr_NombreEmpresa_App, stPr_Archivo_InfoBds, stPr_NombreBd_XTrabajo, _st_Lic);
                            ObjL_Secur.Is_A_Valid_DB_Conn(ref blL_Definio_Servidor, ref blL_Conectar, ref blL_Se_Conecto, ref ObjPr_InfoBD, ObjPr_Conf, TxtUsuario.Text, TxtClave.Text, stPr_Seccion_BaseDeDatos);
                            //
                            if (blL_Definio_Servidor)
                            {
                                // Si definio el servidor lo coloca en la lista y deshabilita el combobox
                                // Asigna el Servior, que tiene la BD
                                LstServidores.Add(ObjPr_InfoBD.getServerName());
                                this.cmbServidores.DataSource = LstServidores;
                                //
                                blL_EstadoCombo = false;
                            }
                            else
                            {
                                // Prende bandera para ocultar la forma y salir de la forma del login.
                                blPr_EscondeForma = true;
                            }

                            //
                        } // Fin de if (blPr_ServidorYaDefinido)
                    }
                    else
                    {
                        SqlDataSourceEnumerator servidores;
                        System.Data.DataTable   tablaServidores;
                        //String servidor;
                        //
                        servidores      = SqlDataSourceEnumerator.Instance;
                        tablaServidores = new DataTable();
                        //
                        // Comprobamos que no se haya cargado ya el combobox
                        if (tablaServidores.Rows.Count == 0)
                        {
                            // Obtenemos un dataTable con la información sobre las instancias visibles
                            // de SQL Server 2000 y 2005
                            tablaServidores = servidores.GetDataSources();
                            // Recorremos el dataTable y añadimos un valor nuevo a la lista con cada fila
                            foreach (DataRow rowServidor in tablaServidores.Rows)
                            {
                                // La instancia de SQL Server puede tener nombre de instancia
                                //o únicamente el nombre del servidor, comprobamos si hay
                                //nombre de instancia para mostrarlo
                                if (String.IsNullOrEmpty(rowServidor["InstanceName"].ToString()))
                                {
                                    LstServidores.Add(rowServidor["ServerName"].ToString());
                                }
                                else
                                {
                                    LstServidores.Add(rowServidor["ServerName"] + "\\" + rowServidor["InstanceName"]);
                                }
                            }

                            // Asignamos al origen de datos del combobox la lista con
                            // las instancias de servidores
                            if (LstServidores.Count == 0)
                            {
                                // Asigna el Servior, que tiene la BD
                                LstServidores.Add(ObjPr_InfoBD.getServerName());
                            }
                            this.cmbServidores.DataSource = LstServidores;
                        }
                        //
                        //SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
                        //System.Data.DataTable table = instance.GetDataSources();
                        //
                        //foreach (System.Data.DataRow row in table.Rows)
                        //{
                        //    foreach (System.Data.DataColumn col in table.Columns)
                        //    {
                        //        Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
                        //    }
                        //}
                        //
                    }
                }    // del if (ObjPr_InfoBD.getTipoBD() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                else // del if (ObjPr_InfoBD.getTipoBD() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                { // del else del if (ObjPr_InfoBD.getTipoBD() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                    // Para los otros tipos de servidores.
                    // Asigna el Servior, que tiene la BD
                    LstServidores.Add(ObjPr_InfoBD.getServerName());
                    // Asignamos la lista al combo
                    this.cmbServidores.DataSource = LstServidores;
                } // del if (ObjPr_InfoBD.getTipoBD() == CLNBTN_IQy.inDB_Types.DB_TYPE_SQLSERVER)
                // Limpia mensaje y deja los controles con el estado que estaban originalmente
                LblMensaje.Text = "";
                //
                cmbServidores.Enabled = blL_EstadoCombo;
                TxtUsuario.Enabled    = blL_EstadoUsuario;
                TxtClave.Enabled      = blL_EstacoClave;
                //
                CmdCancelar.Enabled = true;
                //
                Application.DoEvents();
                Application.DoEvents();
                //
            }
            catch (System.AccessViolationException ex_0)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(3). System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FrmLogin(3). Exception", "", ex.Message.ToString());
            }
        }
Ejemplo n.º 24
0
        private void FileLog_X_Date_Time()
        {
            // Cambia el nombre del archivo de log, para colocarle la fecha y la hora.
            String stL_FechaHora = "";
            String stL_File_Name = "";
            String stL_FechaAux  = "";
            //
            String stL_Ano = "";
            String stL_Mes = "";
            String stL_Dia = "";
            //
            String stL_Hora = "";

            //
            try
            {
                // si no ha hecho la operacion, procede a cambiar el nombre del .log.
                if (!_bl_DateTime_Assigned)
                { // del if (!blPr_YaAsignoFecha_Hora)
                    _bl_DateTime_Assigned = true;
                    //
                    stL_FechaHora = DateTime.Now.ToString();
                    stL_File_Name = _st_PathErrLog;
                    if (stL_File_Name.Length > 0)
                    { // inicio del if ( stL_File_Name.Length > 0 )
                        // cambia la forma de hallar la fecha y la hora
                        // Viene DD/MM/AAAA
                        stL_Ano = DateTime.Now.Year.ToString();  // stL_FechaHora.Substring(6, 4);
                        stL_Mes = DateTime.Now.Month.ToString(); // stL_FechaHora.Substring(3, 2);
                        stL_Dia = DateTime.Now.Day.ToString();   //stL_FechaHora.Substring(0, 2);
                        //
                        if ((Convert.ToInt32(stL_Mes) <= 9) & (stL_Mes.Length == 1))
                        {
                            stL_Mes = "0" + stL_Mes;
                        }
                        if ((Convert.ToInt32(stL_Dia) <= 9) & (stL_Dia.Length == 1))
                        {
                            stL_Dia = "0" + stL_Dia;
                        }
                        //
                        stL_FechaAux = stL_Ano + stL_Mes + stL_Dia;
                        stL_FechaAux = stL_FechaAux.Trim();
                        // //////////////////////////////////////////
                        // Arma el nuevo nombre del archivo de log
                        // Path y Nombre Archivo Log + _AAAAMMDD_HORA + "." + Extension Archivo
                        stL_Hora = DateTime.Now.Hour.ToString();
                        if ((Convert.ToInt32(stL_Hora) <= 9) & (stL_Hora.Length == 1))
                        {
                            stL_Hora = "0" + stL_Hora;
                        }
                        /////////////////////////////////////////////////////
                        // Fin ASQC Marzo 14-18 2013
                        /////////////////////////////////////////////////////
                        stL_FechaAux = "_" + stL_FechaAux + "_" + stL_Hora;
                        //
                        stL_File_Name = Path.GetDirectoryName(stL_File_Name) + "\\" + Path.GetFileNameWithoutExtension(stL_File_Name) + stL_FechaAux + Path.GetExtension(stL_File_Name);
                        // Cambia el nombre del archivo de log
                        _st_PathErrLog = stL_File_Name;
                        //
                    } // Fin del if ( stL_File_Name.Length > 0 )
                }     // del if (!blPr_YaAsignoFecha_Hora)
            }         // del try
            catch (System.AccessViolationException ex_0)
            {
                //
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FileLog_X_Date_Time. System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
                //
            }
            catch (Exception ex)
            {
                //
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "FileLog_X_Date_Time", "", ex.Message.ToString(), "", "");
                //
            }
        }
Ejemplo n.º 25
0
        public void GetParam(String LicName, String WinTittle, String UserName, String LogFile, String ConfFile, String AppInfo_Name, String AppInfo_Ver, String AppInfo_Cia, String InfBdFile, String DBName4Work, ref CLNBTN_IQy Obj_BaseDeDatos, String DBSectionName = "")
        {
            // Toma los parametros.
            String stL_Aux      = "";
            String stL_Mensaje1 = "";
            String stL_Mensaje2 = "";

            CLNBTN_IQy.inDB_Types     inL_TipoBD       = 0;
            CLNBTN_IQy.inConnect_Type inL_TipoConexion = 0;
            CLNBTN_Es ObjL_Encrip = null;

            //
            try
            {
                CLNBTN_Gp ObL_Lic = new CLNBTN_Gp(LicName);
                _st_Lic = ObL_Lic.getLicName();
                if (_st_Lic.Length == 0)
                {
                    MessageBox.Show("Invalid Lic To work");
                }
                // Toma la seccion de la base de datos con la cual va a trabajar.
                stPr_Seccion_BaseDeDatos = DBSectionName;
                // Si viene vacia, toma la seccion SYS_BD_ZERO
                if (stPr_Seccion_BaseDeDatos.Length == 0)
                {
                    stPr_Seccion_BaseDeDatos = SECCION_BD_0;
                }
                // Guarda textos originales.
                stPr_Servidor_Ori = cmbServidores.Text;
                stPr_Usuario_Ori  = TxtUsuario.Text;
                stPr_Clave_Ori    = TxtClave.Text;
                //
                inPr_NumIntentos = 0;
                LblMensaje.Text  = "";
                //
                this.Text              = WinTittle;
                _st_User               = UserName;
                _st_FileLog            = LogFile;
                stPr_ArchivoConfigApp  = ConfFile;
                stPr_Archivo_InfoBds   = InfBdFile;
                stPr_NombreBd_XTrabajo = DBName4Work;
                // Crea instancia para la clase que maneja las configuraciones
                ObjPr_Conf = new CLNBTN_Cg(stPr_ArchivoConfigApp, _st_User, _st_FileLog, _st_Lic);
                //
                ObjPr_Utils = new CLNBTN_Ul(_st_User, _st_FileLog, _st_Lic);
                //
                stPr_Nombre_App        = AppInfo_Name;
                stPr_Version_App       = AppInfo_Ver;
                stPr_NombreEmpresa_App = AppInfo_Cia;
                // Coloca aplicacion y version
                this.LblModuloVersion.Text = stPr_Nombre_App + " " + stPr_Version_App;
                this.LblNombreCia.Text     = stPr_NombreEmpresa_App;
                // La informacion de la base de datos para manejar la conexion con la base de datos.
                ObjPr_InfoBD = new CLNBTN_IQy(_st_Lic);
                ObjPr_InfoBD = Obj_BaseDeDatos;
                //
                // Ejemplo del archivo de configuracion
                //       [SYS_BD_ZERO]
                //Name=Administracion
                //Engine=0
                //Security=4
                //Path=
                //URL=
                //Server=
                //IPAddress=
                //;
                ///////////////////////////////////////////////////////////////
                // Halla Informacion de la base de datos
                ///////////////////////////////////////////////////////////////
                stL_Mensaje1 = "";
                // Nombre de la base de datos.
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "Name");
                if (stL_Aux.Length == 0)
                {
                    stL_Mensaje1 = MENSAJE_1;
                }
                else
                {
                    ObjPr_InfoBD.setDataBaseName(stL_Aux);
                }
                // tipo de Motor de Base de Datos
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "Engine");
                if (stL_Aux.Length == 0)
                {
                    stL_Mensaje1 = MENSAJE_1;
                }
                else
                {
                    inL_TipoBD = (CLNBTN_IQy.inDB_Types)(Convert.ToInt32(stL_Aux));
                    //
                    ObjPr_InfoBD.setDataBaseEngine_Type(inL_TipoBD);
                }
                // Tipo de Conexion
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "Security");
                if (stL_Aux.Length == 0)
                {
                    stL_Mensaje1 = MENSAJE_1;
                }
                else
                {
                    inL_TipoConexion = (CLNBTN_IQy.inConnect_Type)(Convert.ToInt32(stL_Aux));
                    //
                    ObjPr_InfoBD.setDataBaseConn_Type(inL_TipoConexion);
                }
                //
                // Path de la base de datos.
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "Path");
                ObjPr_InfoBD.setDataBasePath(stL_Aux);
                // URL
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "URL");
                ObjPr_InfoBD.setServer_URL(stL_Aux);
                // Nombre de Servidor
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "Server");
                if (stL_Aux.Length == 0)
                {
                    //stL_Mensaje1 = MENSAJE_1;
                }
                else
                {
                    ObjPr_InfoBD.setServerName(stL_Aux);
                }
                // Ip Address
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(stPr_Seccion_BaseDeDatos, "IPAddress");
                ObjPr_InfoBD.setServer_IP_Address(stL_Aux);
                //
                CmdCambiarClave.Enabled = false;
                //
                switch (ObjPr_InfoBD.get_DataBaseConn_Type())
                { // Inicio del switch (ObjPr_InfoBD.getTipoConexion())
                //
                case CLNBTN_IQy.inConnect_Type.TYPE_1_CONNECT_USER_SQL:
                    // Usuario y clave de la bd, vienen en archivo de configuraciones
                    TxtUsuario.Text = _st_User;
                    break;

                case CLNBTN_IQy.inConnect_Type.TYPE_2_CONNECT_USER_APP:
                    // Usuario de la aplicacion, mismo usuario de la base de datos
                    TxtUsuario.Text = _st_User;
                    break;

                case CLNBTN_IQy.inConnect_Type.TYPE_3_CONNECT_USER_WIN:
                    // Usuario Windows es el mismo usuario de la base de datos
                    TxtUsuario.Text         = _st_User;
                    TxtUsuario.Enabled      = false;
                    GrpClave.Visible        = false;
                    TxtClave.Text           = "";
                    CmdCambiarClave.Visible = false;
                    break;

                case CLNBTN_IQy.inConnect_Type.TYPE_4_CONNECT_USER_INFO_EXT:
                    // Conexion tipo Fenix.
                    TxtUsuario.Text = _st_User;
                    if (File.Exists(stPr_Archivo_InfoBds))
                    {
                        ObjPr_InfoBDS_Fenix = new CLNBTN_Cg(stPr_Archivo_InfoBds, _st_User, _st_FileLog, _st_Lic);
                        ObjL_Encrip         = new CLNBTN_Es(_st_User, _st_FileLog, _st_Lic);
                        // Halla y DesEncripta la informacion del servidor
                        stL_Aux = "";
                        stL_Aux = ObjPr_InfoBDS_Fenix.ReadAKeyFromSection(SECCION_BD_CONNECT_INFO, "ServerName");
                        if (stL_Aux.Length != 0)
                        {
                            stL_Aux = ObjL_Encrip.File2Des(stL_Aux, "", "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=", "", _st_Lic);
                            ObjPr_InfoBD.setServerName(stL_Aux);
                            blPr_ServidorYaDefinido = true;
                        }
                        // Halla y DesEncripta la informacion de la base de datos
                        stL_Aux = "";
                        stL_Aux = ObjPr_InfoBDS_Fenix.ReadAKeyFromSection(SECCION_BD_CONNECT_INFO, "DBName");
                        if (stL_Aux.Length != 0)
                        {
                            stL_Aux = ObjL_Encrip.File2Des(stL_Aux, "", "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=", "", _st_Lic);
                            ObjPr_InfoBD.setDataBaseName(stL_Aux);
                        }
                        // Halla y DesEncripta la informacion del usuario
                        stL_Aux = "";
                        stL_Aux = ObjPr_InfoBDS_Fenix.ReadAKeyFromSection(SECCION_BD_CONNECT_INFO, "UID");
                        if (stL_Aux.Length != 0)
                        {
                            stL_Aux = ObjL_Encrip.File2Des(stL_Aux, "", "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=", "", _st_Lic);
                            ObjPr_InfoBD.setDataBase_UserID(stL_Aux);
                        }
                        // Halla y DesEncripta la informacion de la clave
                        stL_Aux = "";
                        stL_Aux = ObjPr_InfoBDS_Fenix.ReadAKeyFromSection(SECCION_BD_CONNECT_INFO, "PWDID");
                        if (stL_Aux.Length != 0)
                        {
                            stL_Aux = ObjL_Encrip.File2Des(stL_Aux, "", "FT/yQYmins06srbyMggYjcEY/ns2slWTURobdSariTY=+-6aUVQ2SZO7QHT6kUHtr2zRbupap5KPu4jeO9GE+UMnk=", "", _st_Lic);
                            ObjPr_InfoBD.setDataBase_UserPWD(stL_Aux);
                        }
                    }
                    break;

                default:
                    //
                    stL_Mensaje2 = MENSAJE_2;
                    break;
                } // Fin de switch (ObjPr_InfoBD.getTipoConexion())
                //
                if (stL_Mensaje1.Length > 0)
                {
                    LblMensaje.Text = stL_Mensaje1;
                }
                if (stL_Mensaje2.Length > 0)
                {
                    if (LblMensaje.Text.Length == 0)
                    {
                        LblMensaje.Text = stL_Mensaje2;
                    }
                    else
                    {
                        LblMensaje.Text = LblMensaje.Text + NEW_LINE + stL_Mensaje2;
                    }
                }
            }
            catch (System.AccessViolationException ex_0)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "GetParam. System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "GetParam. Exception", "", ex.Message.ToString());
            }
        }
Ejemplo n.º 26
0
 public void WriteOutErrorMessage(String st_Componente, String st_ClaseMod, String st_Metodo, String st_CodigoErr, String st_MessaDesc, String st_BD = "", String st_InstSQL = "")
 {
     _st_Line1 = "";
     _st_Line2 = "";
     _st_Line3 = "";
     _st_Line4 = "";
     _st_Line5 = "";
     _st_Line6 = "";
     _st_Line7 = "";
     //
     _st_Mess2Window = "";
     //
     try
     { // inicio del try
         ////////////////////////////////////////////////////////////
         // Arma las lineas que va a escribir o presentar
         ////////////////////////////////////////////////////////////
         _st_Line1 = "*******************************************************************************";
         _st_Line2 = DateTime.Now.ToString() + " USUARIO: " + _st_User;
         _st_Line3 = "COMPONENTE: " + st_Componente;
         _st_Line4 = "CLASE O MODULO: " + st_ClaseMod + " METODO: " + st_Metodo;
         if (st_CodigoErr.Length > 0)
         {
             _st_Line5 = "CODIGO DE ERROR: " + st_CodigoErr;
         }
         //
         if (st_MessaDesc.Length > 0)
         {
             if (_st_Line5.Length != 0)
             {
                 _st_Line5 = _st_Line5 + "\n";
             }
             _st_Line5 = _st_Line5 + "\n" + "DESCRIPCION DEL ERROR: " + st_MessaDesc;
         }
         if (st_BD.Length > 0)
         {
             _st_Line6 = "NOMBRE BD: " + st_BD;
         }
         if (st_InstSQL.Length != 0)
         {
             _st_Line7 = "INSTRUCCION SQL: " + st_InstSQL;
         }
         ////////////////////////////////////////////////////////////
         // Fin de Arma las lineas que va a escribir o presentar
         ////////////////////////////////////////////////////////////
         if (_bl_OutFileLog == true)
         {
             // esta parte debe ser hecha con un thread. validando que el archivo este libre para poder escribirlo.
             if (_bl_Write2Thread)
             {
                 Thread Hilo = new Thread(this.Write_2_Log);
                 Hilo.Start();
             }
             else
             {
                 this.Write_2_Log();
             }
             //
         }
         if (_bl_OutLineConsole == true)
         {
             // Escribe Lineas
             Console.WriteLine(_st_Line1);
             Console.WriteLine(_st_Line2);
             Console.WriteLine(_st_Line3);
             Console.WriteLine(_st_Line4);
             Console.WriteLine(_st_Line5);
             if (_st_Line6.Length > 0)
             {
                 Console.WriteLine(_st_Line6);
             }
             if (_st_Line7.Length > 0)
             {
                 Console.WriteLine(_st_Line7);
             }
             //
             //Console.ReadLine();
         }
         if (_bl_OutWindow == true)
         {
             StringBuilder sb = new StringBuilder();
             sb.Append(_st_Line3);
             sb.Append("\n" + _st_Line4);
             sb.Append("\n" + _st_Line5);
             if (_st_Line6.Length > 0)
             {
                 sb.Append("\n" + _st_Line6);
             }
             if (_st_Line7.Length > 0)
             {
                 sb.Append("\n" + _st_Line7);
             }
             string stL_Message = sb.ToString();
             //
             _st_Mess2Window = stL_Message;
             //ClasX_Utils ShowDialog = new ClasX_Utils("", "");
             //ShowDialog.ShowMessageError(MENSAJE_2, MENSAJE_1, st_Componente, st_ClaseMod, st_Metodo, st_CodigoErr, st_MessaDesc, st_BD, st_InstSQL);
         }
     } // del Try
     catch (System.AccessViolationException ex_0)
     {
         //
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
         //
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "WriteOutErrorMessage. System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
         //
     }
     catch (Exception ex)
     {
         //
         CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, true, false);
         //
         objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "WriteOutErrorMessage", "", ex.Message.ToString(), "", "");
         //
     }
 }
Ejemplo n.º 27
0
        private void Write_2_Log()
        {
            Boolean blL_Flag     = false;
            Boolean blL_CanWrite = false;

            //
            try
            {
                if (_st_PathErrLog.Length > 0)
                {
                    do
                    {
                        while (!blL_CanWrite)
                        {
                            blL_CanWrite = this.CanSystemAccessFile();
                            Application.DoEvents();
                        }
                        //
                        if (blL_CanWrite)
                        {
                            //
                            StreamWriter StLEscritor = new StreamWriter(_st_PathErrLog, true, Encoding.ASCII);
                            string       SLFecha     = DateTime.Now.ToString();
                            StLEscritor.WriteLine(_st_Line1);
                            StLEscritor.WriteLine(_st_Line2);
                            StLEscritor.WriteLine(_st_Line3);
                            if (_st_Line4.Length > 0)
                            {
                                StLEscritor.WriteLine(_st_Line4);
                            }
                            if (_st_Line5.Length > 0)
                            {
                                StLEscritor.WriteLine(_st_Line5);
                            }
                            if (_st_Line6.Length > 0)
                            {
                                StLEscritor.WriteLine(_st_Line6);
                            }
                            if (_st_Line7.Length > 0)
                            {
                                StLEscritor.WriteLine(_st_Line7);
                            }
                            StLEscritor.Close();
                            StLEscritor.Dispose();
                            //
                            blL_Flag = true;
                            if (Hilo != null)
                            {
                                if (!Hilo.IsAlive)
                                {
                                    Hilo.Abort();
                                }
                            }
                        }
                    } while (!blL_Flag);
                }
            }
            catch (System.AccessViolationException ex_0)
            {
                //
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, false, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Write_2_Log. System.AccessViolationException", "", ex_0.Message.ToString(), "", "");
                //
            }
            catch (IOException ex)
            {
                //
                if (!IsSystemFileLocked(ex))
                {
                    CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, false, false);
                    //
                    objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Write_2_Log. IOException", "", ex.Message.ToString(), "", "");
                }
                //
            }
            catch (Exception ex_1)
            {
                //
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_PathErrLog, false, false, false);
                //
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "Write_2_Log. Exception", "", ex_1.Message.ToString(), "", "");
                //
            }
        }
Ejemplo n.º 28
0
        public void GetParam(String LicName, String WinTittle, String UserName, String LogFile, String ConfFile, String AppInfo_Name, String AppInfo_Ver, String AppInfo_Cia, ref CLNBTN_IQy Obj_BaseDeDatos)
        {
            // Toma los parametros.
            String stL_Aux = "";

            try
            {
                CLNBTN_Gp ObL_Lic = new CLNBTN_Gp(LicName);
                _st_Lic = ObL_Lic.getLicName();
                if (_st_Lic.Length == 0)
                {
                    MessageBox.Show("Invalid Lic To work");
                }
                // Guarda textos originales.
                stPr_Clave_Ori  = TxtClave.Text;
                stPr_Clave1_Ori = TxtClave1.Text;
                stPr_Clave2_Ori = TxtClave2.Text;
                //
                inPr_NumIntentos = 0;
                LblMensaje.Text  = "";
                //
                this.Text             = WinTittle;
                _st_User              = UserName;
                _st_FileLog           = LogFile;
                stPr_ArchivoConfigApp = ConfFile;
                //
                stPr_Nombre_App        = AppInfo_Name;
                stPr_Version_App       = AppInfo_Ver;
                stPr_NombreEmpresa_App = AppInfo_Cia;
                // Coloca aplicacion y version
                this.LblModuloVersion.Text = stPr_Nombre_App + " " + stPr_Version_App;
                this.LblNombreCia.Text     = stPr_NombreEmpresa_App;
                //
                // Crea instancia para la clase que maneja las configuraciones
                ObjPr_Conf = new CLNBTN_Cg(stPr_ArchivoConfigApp, _st_User, _st_FileLog, _st_Lic);
                //
                ObjPr_Utils = new CLNBTN_Ul(_st_User, _st_FileLog, _st_Lic);
                //
                // Lee el esquema de color
                stL_Aux = "";
                stL_Aux = ObjPr_Conf.ReadAKeyFromSection(SECCION_ID_APP, "Color");
                if (stL_Aux.Length == 0)
                {
                    stL_Aux = "0";
                }
                // La informacion de la base de datos para manejar la conexion con la base de datos.
                ObjPr_InfoBD = new CLNBTN_IQy(_st_Lic);
                ObjPr_InfoBD = Obj_BaseDeDatos;
                //
                if (ObjPr_InfoBD.getUserApp_PWD().Length == 0)
                {
                    GrpClave.Visible = false;
                }
                //
                HabilitaBotones();
                CmdCancelar.Enabled = true;
                //
            }
            catch (System.AccessViolationException ex_0)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "GetParam. System.AccessViolationException", "", ex_0.Message.ToString());
            }
            catch (Exception ex)
            {
                CmdCancelar.Enabled = true;
                CLNBTN_Lg objL_Log = new CLNBTN_Lg(_st_User, _st_FileLog, _bl_OutLineConsole, _bl_OutFileLog, _bl_OutWindow);
                objL_Log.WriteOutErrorMessage(_st_Relac, _st_RelacSon, "GetParam. Exception", "", ex.Message.ToString());
            }
        }