Hello i am currently developing a program where u send data to a ftp to server once your connected and it displays the response from the server in a listbox. my problem is that my listbox will only contain the intial banner and nothing else from the ftp server, for example once i connect and send the command USER anonymous, i dont have the response in my listbox which should be 331 Please specify the password. is there any help u guys can provide? im using winsock and will include my code below, thank you





Public



Class Form1




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click




On Error Resume Next

sock.Protocol = MSWinsockLib.ProtocolConstants.sckTCPProtocol



sock.Connect(txtip.Text, txtport.Text)

ListBox1.Items.Add(

"connecting to " & txtip.Text & ": " & txtport.Text & vbNewLine)




End Sub



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ListBox1.Anchor = AnchorStyles.Top




End Sub



Private Sub sock_ConnectionRequest(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_ConnectionRequestEvent) Handles sock.ConnectionRequest

sock.Close()

sock.Accept(e.requestID)




End Sub



Private Sub sock_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles sock.DataArrival




On Error Resume Next



Dim incoming As String = "data"

sock.GetData(incoming)

ListBox1.Items.Add(incoming & vbNewLine)

incoming = (

"data")






End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click




On Error Resume Next

sock.Close()



If sock.CtlState = MSWinsockLib.StateConstants.sckClosed Then

ListBox1.Items.Add(

"disconnected from " & txtip.Text)




End If



End Sub



Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

sock.SendData(


"NOOP")




End Sub



Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

sock.SendData(


"USER anonymous")




End Sub



Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

sock.SendData(


"PASS [email protected]")




End Sub



Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged




End Sub



Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click




On Error Resume Next



Dim contact As Boolean = False

sock.SendData(

CStr(TextBox1.Text))




End Sub

End




Class