otherside
Well-known member
Code:
Dim StrGet As String = "user otherside"
Dim ByteGet As Byte() = ASCII.GetBytes(StrGet)
Dim Str As Byte() = Encoding.ASCII.GetBytes("USER Oth")
Dim RBytes(256) As Byte
Dim HostCon As New IPEndPoint(IPAddress.Parse("192.168.0.1"), 21)
Dim Soc As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Soc.Connect(HostCon)
If Soc.Connected Then
Soc.Receive(RBytes, RBytes.Length, SocketFlags.None)
Dim msg As String = Encoding.ASCII.GetString(RBytes)
MessageBox.Show(msg)
Soc.Send(Str, Str.Length, SocketFlags.None)
MessageBox.Show("Data Sent")
End If
On one hand it works, (compiles and runs) but the data that sends never get to the server.
any idea whats wrong? or any alternative solution ?
thanks guys