Hi all,

I am trying to interface FTP and TCP. With the click of a printer button. i need to put file in the server and then open tcp port to send commands. I am trying to use this code which is kinda using one for FTP and other for TCP.

looking for help .....


Private Sub cmdprinter1_click()
Inet2.Protocol = icFTP
Inet2.URL = "ftp://0.0.0.0"
Inet2.UserName = "anonymous"
Inet2.Password = "cool"

Dim RemoteFileName As String
txtfilename.Text = "text.txt"

RemoteFileName = txtfilename.Text

Inet2.Execute , "PUT " & RemoteFileName & " " & txtfilename.Text
End Sub
Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
tcpClient.GetData strData
txtReceive.Text = strData
End Sub
Private Sub cmdSend_Click()
'// send the data
tcpClient.SendData txtSend.Text & Chr$(10)
End Sub
Private Sub cmdConnect_Click()
'// connect
txtPCName.Text = "0.0.0.0"
tcpClient.RemotePort = 1234
tcpClient.RemoteHost = txtPCName.Text
tcpClient.Connect
End Sub