fdiedler http://www.tutoworld.com | Code :
- Imports System.Net
- Public Class F_Svr
- Inherits System.Windows.Forms.Form
- Private Sub NListen_MessageReceive(ByVal Data As String, ByVal Sck As System.Net.Sockets.Socket) Handles NListen.MessageReceive
- Dim Ret() As String = Split(Data, ControlChars.CrLf)
- Dim IP As String = IPAddress.Parse(CType(Sck.RemoteEndPoint, IPEndPoint).Address.ToString()).ToString()
- Dim Ch As String = ControlChars.VerticalTab
- Select Case Data.Length
- Case Is = 0 '# Gere un déco du socket
- Dim ret0 As List_Info_Client = CType(Listing.Item(IP), List_Info_Client)
- With ret0
- NListen.Send("616" & Ch & .Pseudo_Principal & ControlChars.CrLf)
- End With
- Call Deco_Clt(Sck, IP)
- Case Is > 0
- Dim i As Integer = 0
- For i = LBound(Ret) To UBound(Ret)
- If Ret(i) <> "" Then
- Dim Ret0() As String = Split(Ret(i), ControlChars.VerticalTab)
- Select Case Ret0(0)
- Case "1"
- Call Deco_Clt(Sck, IP)
- NListen.Send(Data)
- Case "10"
- NListen.Send(Data)
- Case "199"
- Timer1.Enabled = True
- Timer1.Start()
- End Select
- End If
- Next
- End Select
- End Sub
- Private Sub NListen_ConnectStatut(ByVal State As Boolean) Handles NListen.ConnectStatut
- Select Case State
- Case False : B_Connect.Text = "Connection"
- Case True : B_Connect.Text = "Déconnection"
- End Select
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Dim ret As String = "200" & ControlChars.VerticalTab
- Call NListen.Send(ret)
- Timer1.Stop()
- End Sub
- End Class
|
Voila g virer tt ce qui n'etait pas en rapport ( sinon le code serais trop long )
Merci |