1 Attachment(s)
VB6 - FTP Class for people doing FTP - FTP made easy
NOTE: Add reference to FTPC.dll first.
VB Code:
'To use the object, declare it then create a new instance of it
Dim WithEvents objFTPC As FTPClient
Set objFTPC = New FTPClient
'To connect, supply it with required parameters
objFTPC.Username = "Anonymous"
objFTPC.Password = "Guest"
objFTPC.PassiveMode = True
objFTPC.RemoteHost = "ftp.ftphost.com"
objFTPC.RemotePort = 21
objFTPC.Connect
'To upload data,
objFTPC.OpenDataConnection
'Wait for Data socket to be connected
Do Until objFTPC.DataState = DS_CONNECTED
DoEvents
Loop
'Upload data
objFTPC.UploadFile "readme.txt"
'Then upload ur data whenever NeedData event is fired
Private Sub objFTPC_NeedData()
objFTPC.SendData "My data"
End Sub
'To download data,
objFTPC.OpenDataConnection
'Wait for Data socket to be connected
Do Until objFTPC.DataState = DS_CONNECTED
DoEvents
Loop
'Download data
objFTPC.DownloadFile "readme.txt"
'Then download ur data whenever IncomingData event is fired
Private Sub objFTPC_IncomingData(BytesTotal As Long)
Dim sData As String
objFTPC.GetData sData
End Sub
'That cover the basics. For more advance functions, post it here
Re: VB6 - FTP Class for people doing FTP - FTP made easy
when I get to SckCmd.GetData sData in SckCmd_DataArrival i keep getting the following error:
? err.Description
Wrong protocol or connection state for the requested transaction or request
? err.Number
40006
Does this mean the program has yet to connect to the winsock?
Re: VB6 - FTP Class for people doing FTP - FTP made easy
it probably means it's already connected and closed.
I've done a complete rewrite. Check this link:
http://www.vbforums.com/showthread.php?t=278007
Re: VB6 - FTP Class for people doing FTP - FTP made easy
sir can u explain to the code above..one by one for me to understand all the code..stands for...
Many thanks,
-chito
Re: VB6 - FTP Class for people doing FTP - FTP made easy
Hello.
First of all:
Thanks fpr your work.
But im sorry, i could not handle it.
It was tooo curious and complicated.
Then i found this:
http://www.mcmillan.org.nz/paradoxes/code/FTPClass.html
and its realy great, and from my point of view, its much better and easyer.
Thanks, and best wished from vienna.
Tom www.lookover.at
Re: VB6 - FTP Class for people doing FTP - FTP made easy
to lookover.at
this code http://www.mcmillan.org.nz/paradoxes/code/FTPClass.html
is not an asynchronous.. it easyer ,but,More bad
Re: VB6 - FTP Class for people doing FTP - FTP made easy
1 Attachment(s)
Re: VB6 - FTP Class for people doing FTP - FTP made easy
Hi, i am trying to add this .dll but get an error and it wont add it ?
Attachment 91555
What have i done wrong ?
Thanks
Re: VB6 - FTP Class for people doing FTP - FTP made easy
Well for one thing you're posting in a VB6 section and you're using VBdotNet.
But this also isn't the best place to ask a question. Once a CodeBank thread goes inactive it's really for reference and not actively monitored.
Re: VB6 - FTP Class for people doing FTP - FTP made easy