Hola, hace un tiempo, he estado intentando crear un chat, en vb6, pero resulta que siempre la primera linea de este codigo" Private Sub cmdListen_Click() " me tiraba un error, este es el codigo:
Código:Private Sub cmdListen_Click() If socket.Enabled = True Then socket.Close End If socket.LocalPort = "55" socket.Listen cmdSend.Enabled = True txtlog = txtlog & "[Servidor] - Servidor de Chat Iniciando en Puerto: " & socket.LocalPort & vbCrLf End Sub
El codigo entero es este_
Y esta es la imagen de mi proyecto:Código:Private Sub cmdListen_Click() If socket.Enabled = True Then socket.Close End If socket.LocalPort = "55" socket.Listen cmdSend.Enabled = True txtlog = txtlog & "[Servidor] - Servidor de Chat Iniciando en Puerto: " & socket.LocalPort & vbCrLf End Sub Private Sub cmdSend_Click() If txtsend = "" Then Else socket.SendData txtsend txtsend = "" End If End Sub Private Sub Form_Load() cmdSend.Enabled = False End Sub Private Sub socket_ConnectionRequest(ByVal requestID As Long) If socket.State <> sckClosed Then socket.Close Else End If socket.Accept requestID txtlog = txtlog & "[Servidor] Cliente conectado desde la Ip: " & socket.RemoteHostIP End Sub Private Sub socket_DataArrival(ByVal bytesTotal As Long) Dim datos As String socket.GetData datos txtlog = txtlog & "[Text1.Text] - " & datos & vbCrLf End Sub
De ante mano muchas gracias.
PD: Excelente Foro