Probleme urgent sur winsock

cs_diksa222 Messages postés 45 Date d'inscription dimanche 9 mars 2003 Statut Membre Dernière intervention 6 mai 2004 - 29 juin 2003 à 06:00
cs_diksa222 Messages postés 45 Date d'inscription dimanche 9 mars 2003 Statut Membre Dernière intervention 6 mai 2004 - 30 juin 2003 à 01:57
regarder ma source coté client :
Private Sub Form_Load()
On Error Resume Next 'en cas d'erreur faire la ligne de commande suivante
Nick2 = "client"
Nick2 = InputBox("quel est ton surnom", "ton surnom", "client")
Do While Nick2 = ""
Nick2 = InputBox("quel est ton surnom", "ton surnom", "client")
Loop
end sub

Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim Nick As String
Dim Donnée As String
Dim ErrMsg As String
tcpClient.GetData Donnée
tcpClient.GetData Nick
If Left(ErrMsg, 4) = "Err(" Then
ErrMsg = Mid(Donnée, 5, Len(Donnée) - 5)
MsgBox ErrMsg, vbInformation, "Rapport d'erreur"
Else
Text1.Text = Text1.Text & vbCrLf & "<" & Nick & ">" & Donnée
End If
End Sub

coté server :

Private Sub Form_Load()
Nick = "server"
Nick = InputBox("quel est ton surnom", "ton surnom", "server")
Do While Nick = ""
Nick = InputBox("quel est ton surnom", "ton surnom", "server")
Loop
End Sub

Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim Donné As String
Dim ErrMsg As String
Dim Nick2 As String
tcpServer.GetData Donné
If Left(Donné, 4) = "Err(" Then
ErrMsg = Mid(Donné, 5, Len(Donné) - 5)
MsgBox ErrMsg, vbInformation, "Rapport d'erreur"

Else
Text1.Text = Text1.Text & vbCrLf & "<" & Nick2 & "> " & Donné

End If
End Sub
voila donc j'ai le texte ki s'affiche dans la texte box de mon chat mais pour le nick ya juste du blanc entre les <> donc si kelkun s'est ou est l'erreur

2 réponses

cs_diksa222 Messages postés 45 Date d'inscription dimanche 9 mars 2003 Statut Membre Dernière intervention 6 mai 2004
29 juin 2003 à 06:02
voila la bonne source

regarder ma source coté client :
Private Sub Form_Load()
On Error Resume Next 'en cas d'erreur faire la ligne de commande suivante
Nick2 = "client"
Nick2 = InputBox("quel est ton surnom", "ton surnom", "client")
Do While Nick2 = ""
Nick2 = InputBox("quel est ton surnom", "ton surnom", "client")
Loop
end sub

Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim Nick As String
Dim Donnée As String
Dim ErrMsg As String
tcpClient.GetData Donnée
tcpClient.GetData Nick
If Left(ErrMsg, 4) = "Err(" Then
ErrMsg = Mid(Donnée, 5, Len(Donnée) - 5)
MsgBox ErrMsg, vbInformation, "Rapport d'erreur"
Else
Text1.Text = Text1.Text & vbCrLf & "<" & Nick & ">" & Donnée
End If
End Sub

coté server :

Private Sub Form_Load()
Nick = "server"
Nick = InputBox("quel est ton surnom", "ton surnom", "server")
Do While Nick = ""
Nick = InputBox("quel est ton surnom", "ton surnom", "server")
Loop
End Sub

Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim Donné As String
Dim ErrMsg As String
Dim Nick2 As String
tcpServer.GetData Donné
tcpServer.GetData Nick2
If Left(Donné, 4) = "Err(" Then
ErrMsg = Mid(Donné, 5, Len(Donné) - 5)
MsgBox ErrMsg, vbInformation, "Rapport d'erreur"

Else
Text1.Text = Text1.Text & vbCrLf & "<" & Nick2 & "> " & Donné

End If
End Sub
voila donc j'ai le texte ki s'affiche dans la texte box de mon chat mais pour le nick ya juste du blanc entre les <> donc si kelkun s'est ou est l'erreur
0
cs_diksa222 Messages postés 45 Date d'inscription dimanche 9 mars 2003 Statut Membre Dernière intervention 6 mai 2004
30 juin 2003 à 01:57
ya personne pr m'aider
0
Rejoignez-nous