How can I download a textfile from the internet through my visual basic program ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How can I download a textfile from the internet through my visual basic program ?

  1. #1
    Johny John Guest

    How can I download a textfile from the internet through my visual basic program ?


    Hello fellow coders,
    I am trying to download a text file from a certain address on the internet.
    How can I download this file from within my visual basic program ?

    Thank You

  2. #2
    Alan Griggs Guest

    Re: How can I download a textfile from the internet through my visual basic program ?


    JJ,

    Use a winsock tool (e.g. Spyworks from Desaware), write the code in the winsock
    API, write the code in the Wininet API, use the Internet Transfer Control
    included with VB, or use the Winsock control included with Visual Basic.
    The choice depends upon how bullet proof your program needs to be.

    If you are using the winsock control, drop it on a form, set the protocol
    to TCP, the remote host property, the remote port property to 80. Issue
    a properly formed (don't ask me) HTTP request like "HTTP 1.0 GET document.txt".
    Then your file should start coming back in your data received event.

    If you are using the Internet transfer control, make sure you have the latest
    service pack for VB installed.

    HTH,


    Alan Griggs


    "Johny John" <jjohn@wam.umd.edu> wrote:
    >
    >Hello fellow coders,
    > I am trying to download a text file from a certain address on the internet.
    >How can I download this file from within my visual basic program ?
    >
    >Thank You



  3. #3
    Jeff Knapp Guest

    Re: How can I download a textfile from the internet through my visual basic program ?

    "Alan Griggs" <agriggs@ieee.org> wrote in <3a3693fb$1@news.devx.com>:

    >
    >JJ,
    >
    >Use a winsock tool (e.g. Spyworks from Desaware), write the code in the
    >winsock API, write the code in the Wininet API, use the Internet
    >Transfer Control included with VB, or use the Winsock control included
    >with Visual Basic.
    > The choice depends upon how bullet proof your program needs to be.
    >
    >If you are using the winsock control, drop it on a form, set the
    >protocol to TCP, the remote host property, the remote port property to
    >80. Issue a properly formed (don't ask me) HTTP request like "HTTP 1.0
    >GET document.txt".
    > Then your file should start coming back in your data received event.
    >
    >If you are using the Internet transfer control, make sure you have the
    >latest service pack for VB installed.


    Or Karl Petersen has an AWESOME ActiveX EXE that does it all for you, with
    a cool dialog box and everything. :-)

    You can grab it from his site:

    http://www.mvps.org/

    It's on his controls page, or grab the zip file from:

    http://www.mvps.org/vb/code/vbInet.zip

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center