Results 1 to 10 of 10

Thread: VB6 - FTP Class for people doing FTP - FTP made easy

  1. #1

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    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:
    1. 'To use the object, declare it then create a new instance of it
    2. Dim WithEvents objFTPC As FTPClient
    3. Set objFTPC = New FTPClient
    4. 'To connect, supply it with required parameters
    5. objFTPC.Username = "Anonymous"
    6. objFTPC.Password = "Guest"
    7. objFTPC.PassiveMode = True
    8. objFTPC.RemoteHost = "ftp.ftphost.com"
    9. objFTPC.RemotePort = 21
    10. objFTPC.Connect
    11. 'To upload data,
    12. objFTPC.OpenDataConnection
    13. 'Wait for Data socket to be connected
    14. Do Until objFTPC.DataState = DS_CONNECTED
    15.     DoEvents
    16. Loop
    17. 'Upload data
    18. objFTPC.UploadFile "readme.txt"
    19. 'Then upload ur data whenever NeedData event is fired
    20. Private Sub objFTPC_NeedData()
    21. objFTPC.SendData "My data"
    22. End Sub
    23.  
    24. 'To download data,
    25. objFTPC.OpenDataConnection
    26. 'Wait for Data socket to be connected
    27. Do Until objFTPC.DataState = DS_CONNECTED
    28.     DoEvents
    29. Loop
    30. 'Download data
    31. objFTPC.DownloadFile "readme.txt"
    32. 'Then download ur data whenever IncomingData event is fired
    33. Private Sub objFTPC_IncomingData(BytesTotal As Long)
    34. Dim sData As String
    35. objFTPC.GetData sData
    36. End Sub
    37. 'That cover the basics. For more advance functions, post it here
    Attached Files Attached Files
    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

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  2. #2
    New Member
    Join Date
    Mar 2007
    Posts
    1

    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?

  3. #3

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    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
    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

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  4. #4
    New Member chito's Avatar
    Join Date
    Feb 2011
    Location
    Philippines
    Posts
    4

    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

  5. #5
    New Member
    Join Date
    May 2011
    Posts
    2

    Resolved 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

  6. #6
    New Member
    Join Date
    Dec 2011
    Posts
    3

    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

  7. #7
    Lively Member
    Join Date
    May 2009
    Location
    EG
    Posts
    87

    Re: VB6 - FTP Class for people doing FTP - FTP made easy

    have you check this out

  8. #8
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    467

    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 ?

    Name:  dllerror.jpg
Views: 7715
Size:  81.6 KB

    What have i done wrong ?

    Thanks

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    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.

  10. #10
    Lively Member
    Join Date
    May 2009
    Location
    EG
    Posts
    87

    Re: VB6 - FTP Class for people doing FTP - FTP made easy


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width