I bet u need a fusion powered shuttle to reach my place...
Posts
963
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
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline
So I consider all those working engineers sad people
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline
So I consider all those working engineers sad people