Results 1 to 20 of 20

Thread: FTP Code Please!!!

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking FTP Code Please!!!

    In my experience I can never get the Inet1 Control to work for me. I have heard there are other ways for me to upload and download files over the Internet. Can someone point me in the right direction please?

    Thanks

  2. #2
    ATommasi
    Guest

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well its quite simple if you use the winsock control to do it.
    You connect and send plaintext commands etc.

    Try telnetting to an ftp server on port 21.
    You'll see what I mean.

    In relation to retreiving the data, if you're not in passive mode, then as far as I know the client tells the server what local port to connect to, the server connects, and the data is sent.

    If you get an ftp client they usually show you all the commands being issued anyway.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Might want to go search for a freeware FTP control . Inet control kind of bites.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    I think I am going to do just that and find a component to do the uploading and downloading.

    Another question

    Assuming I know my log in Id and passwords, how can I search the entire contents of a specific file on the remote server and report back all the file names ?

    Thanks again

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I think you'd have to recursively go thru each directory on the server and get a list of files....
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    you would have to download the file and search through it in your program. FTP has nothing that allows you to do that. Unless you want to write your own ftp server to do that.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    plenderj thanks but I am new to this...any code examples to get me going?
    thanks

  9. #9
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Now to get a list of files from an ftp server, there is an actual ftp command to do that. Any ftp control will have it built in with a method, but if you were to do it with winsock, the command to send would ls if I remember correctly. It woudl then send you back the list of files. But like I said, and FTP control would simplify this. Im sure there are some good free or very cheap ones out there.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    Isn't there some call I can do to retrieve the name of my files in a directory on the remote server?

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    Cander forgive my ignorance but you mean an actual .DLL or .Exe FTP control or just a simple program?

  12. #12
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    To get a list of files+folders off the current folder you send the LIST command.
    To find all files+folders on the server, you would send the LIST command, then go into each one of those directories and do LIST and so on ad nauseum.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  13. #13
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Just write your program as an exe and use a thrid party FTP control to handle the FTP code. Makes iot tons easier
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    Cander all I know is ComponentSource.com. Is that a good place to start?

    thanks

  15. #15
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    you could use wininet API calls

    download this example Vbsmpftp.exe from here:

    (it's a self extracting zip file)
    http://support.microsoft.com/support.../Q195/6/53.ASP
    Mark
    -------------------

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    thanks Mark for the info ... have you heard of the FTp component PowerTCP FTP Tool?

  17. #17

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    the component mentioned above gives this spec.

    what does it mean?
    Software Required: Winsock 2, DCOM95


    I have Windows 2000 Professional as a development machine and this COM may run on 2000 Server.

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    hey RyeBread thanks for the info!

  19. #19
    Lively Member L0phtpDK's Avatar
    Join Date
    Mar 2001
    Location
    ILL
    Posts
    109

    more info

    I've tired to make a FTP program (sorta worked.. but i got stuck in a section)

    here are some links that you could probaly use:

    http://www.vbip.com/winsock/winsock_ftp_01.asp
    http://www.vbip.com/winsock/winsock_ftp_ref_01.htm

    They should help ya too
    I have no real reason to put anything here....

  20. #20

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    thank you

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