Results 1 to 5 of 5

Thread: reading an internet file from form

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Talking

    if i had a text file at "www.whatever.com/textfile.txt"
    how would I read from it from my computer?
    with an internet transfer control, if so, how?

    thanks in advance

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Try this

    Fill a byte array with the data from the file (that you can download using the internet transfer control) then display the array in a text box.

    I'm sorry i can't provide an example, as I only have VB Learning Edition at the moment, and it doesn't include the internet controls

    Hope this helps.

    Bye
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Cool

    helps, but only half way...

    How do I setup the Internet Transfer Control to connect to the site and read the text file??

  4. #4

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    anybody?

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Code:
    MyString = Inet1.OpenUrl("MYSITE")
    Text1.Text = MyString
    That's the syntax. It has a lot more things to configure if you want (Proxy, port etc.), just look at the properties and methods.

    You don't have to fill it in a byte array because this is a text file and is in the ASCII format. If you want to download progs you need to do:

    Code:
    Dim b() As Byte
    
    b() = Inet1.OpenUrl("http://www.site.com/file.exe")
    
    Open MYLOCALFILE For Binary Access Write As #1
    Put #1, , b()
    Close #1
    Have fun!

    [Edited by Jop on 09-08-2000 at 07:36 PM]
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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