Results 1 to 4 of 4

Thread: reading text from url and load it in array

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    7

    Smile reading text from url and load it in array

    hello guys, help me.

    I want to open a text file from a url (example: http://domain.com/mytext.txt)

    and then load it into array. (Separated by new line)

    I appreciate full code for this or write for me easily. I'm new for vb syntax but I need to develop an application immediately and I'm experienced with other technologies.


    I have another question. I'm thinking to develop a simple chat application. I'm thinking to write/read all chat messages in xml. is the idea logical for chat application development?


    Thank you
    Last edited by runningtrain; Feb 21st, 2010 at 01:01 AM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: reading text from url and load it in array

    vb Code:
    1. Dim wc As New Net.WebClient
    2. wc.DownloadFile("http://www.domain.com/mytext.txt", "temp.txt")
    3. Dim lines() As String = IO.File.ReadAllLines("temp.txt")

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    7

    Re: reading text from url and load it in array

    @paul does it work in vb6? vb6 finds error last two lines

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: reading text from url and load it in array

    this is the vb.net forum. try asking in the classic vb forum

Tags for this Thread

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