Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Chat v.1.0 - Server.frm

Server.frm

Caricato da:
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4. txtOut.Text = "Connessione terminata"
  5. wskServer.SendData txtOut.Text & vbCrLf
  6. End
  7. End Sub
  8.  
  9. Private Sub Command2_Click()
  10. AboutHelp.Show 1
  11. End Sub
  12.  
  13. Private Sub Listen_Click()
  14.     wskServer.Close
  15.     wskServer.LocalPort = 2000
  16.     wskServer.Listen
  17.     txtReply.Text = txtReply.Text & "Server in attesa..." & vbCrLf
  18.     txtReply.SelStart = Len(txtReply.Text)
  19. End Sub
  20.  
  21. Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
  22.     If (wskServer.State <> sckClosed) Then wskServer.Close
  23.     wskServer.Accept requestID
  24.     txtReply.Text = txtReply.Text & "Connessione accettata..." & vbCrLf
  25.     txtReply.SelStart = Len(txtReply.Text)
  26. End Sub
  27.  
  28. Private Sub wskServer_DataArrival(ByVal bytesTotal As Long)
  29.     Dim DATI As String
  30.     wskServer.GetData DATI
  31.     txtReply.Text = txtReply.Text & DATI & vbCrLf
  32.     txtReply.SelStart = Len(txtReply.Text)
  33. End Sub
  34.  
  35. Private Sub Invia_Click()
  36.     If wskServer.State <> sckConnected Then
  37.         txtReply.Text = txtReply.Text & "Non connesso" & vbCrLf
  38.         txtReply.SelStart = Len(txtReply.Text)
  39.         Exit Sub
  40.     End If
  41.     wskServer.SendData txtOut.Text & vbCrLf
  42. End Sub