This document contains code for validating login credentials in Visual Basic. It checks that the agent ID and password fields are filled before attempting to send the login request. Error messages are displayed if the fields are empty. The login request is sent over TCP with the agent ID, password and other data if validation passes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
21 views3 pages
Ejemplo 1
This document contains code for validating login credentials in Visual Basic. It checks that the agent ID and password fields are filled before attempting to send the login request. Error messages are displayed if the fields are empty. The login request is sent over TCP with the agent ID, password and other data if validation passes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
txtAgente
txtPassword
CmdEnviar Codigo del botob ACEPTAR
Public Sub CmdEnviar_Click()
On Error GoTo MalEnv BE = txtBE.Text If Len(frmLogin.txtAgente) = 0 Then Beep stbar.Panels(1).Text = "Error. Clave del agente en blanco. Trate nuevamente" ' Call Pausa(3) txtAgente.SetFocus Exit Sub Else Age = frmLogin.txtAgente End If If Len(frmLogin.) = 0 Then Beep stbar.Panels(1).Text = "Error. Contraseña del agente en blanco. Trate nuevamente" ' Call Pausa(3) txtPassword.SetFocus Exit Sub Else Pas = frmLogin.txtPassword End If CmdEnviar.Enabled = False stbar.Panels(1).Text = "Validando agente, espere por favor..." frmLogin.MousePointer = 11 ' Call Pausa(3) tcpClient.SendData (RTrim(Age) & "," & RTrim(Pas) & BE) txtBE.Text = "" CmdEnviar.Enabled = True Exit Sub Private Sub txtAgente_GotFocus() On Error GoTo error stbar.Panels(1).Text = "Teclee la clave del agente y presione [ Enter ]" error: If Not Err = 0 Then MsgBox (Err.Number & " " & Err.Description & " " & Err.Source & " txtAgente_GotFocus") End Sub
Private Sub txtPassword_GotFocus()
On Error GoTo error CmdEnviar.Enabled = True stbar.Panels(1).Text = "Teclee la contraseña del agente y presione [ Enter ]" error: If Not Err = 0 Then MsgBox (Err.Number & " " & Err.Description & " " & Err.Source & " txtPassword_GotFocus") End Sub