Results 1 to 9 of 9

Thread: [RESOLVED]FTP Download file to string

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    14

    [RESOLVED]FTP Download file to string

    First attempt at this......

    I need to open FTP directory and download a file into a string......

    Any code examples would be greatly appreciated....

    I have searched and searched...but can't tell the difference between all
    the different versions of VB....

    VB 2005 Express
    Last edited by wazntme; Aug 9th, 2007 at 09:53 PM.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    413

    Re: FTP Download file to string

    Visual Studio .NET 2005/.NET Framework 2.0

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: FTP Download file to string

    WebClient.DownloadString
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    New Member
    Join Date
    Jun 2007
    Posts
    4

    Re: FTP Download file to string

    See the following component.

    http://www.jscape.com/sftpdotnet/

    the Ftp.Download(Stream out, String filename)

    the "out" variable can be a MemoryStream which you can then convert to a byte[] and to a String.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    14

    Re: FTP Download file to string

    OK thanks...

    I can download a file to a .bin
    How would I get that into a textbox? or string?

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: FTP Download file to string

    as jmcilhinney said, use WebClient.DownloadString
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    14

    Re: FTP Download file to string

    Quote Originally Posted by Atheist
    as jmcilhinney said, use WebClient.DownloadString
    Sorry, new.....

    Can you give me a little more info...

    how to incorporate username/password
    Last edited by wazntme; Aug 9th, 2007 at 07:09 PM.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: FTP Download file to string

    Quote Originally Posted by wazntme
    Sorry, new.....

    Can you give me a little more info...

    how to incorporate username/password
    Read the documentation for the WebClient class and, particularly, the DownloadString method. If you still don't understand then you should ask but you should be erading the documentation first.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    14

    Re: FTP Download file to string

    Thanks for the point in the right direction...

    Got it...Easier that I thought.......

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