Results 1 to 11 of 11
  1. #1
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107

    [help]read text from an online .txt[Solved]

    ok so i want to show text from a site in a textbox but not like getelement by id or anything, but like read the whole page of an online .txt so like the urls that are like https://www.example.com/example.txt and read everything from that "textfile".(don't flame me im trying new stuff(AND YES I HAVE TRIED MY SELF AND I HAVE PRESSED THE SEARCH BUTTON)



  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]imports system.net
    imports system.text
    imports system.io[/php]

    [php]Private Function loadPage(ByVal page As String) As String
    Dim req As WebRequest = WebRequest.Create(page)
    Dim resp As WebResponse = req.GetResponse()

    Dim s As Stream = resp.GetResponseStream()
    Dim sr As StreamReader = New StreamReader(s, Encoding.ASCII)
    Dim doc As String = sr.ReadToEnd()
    Return doc
    End Function[/php]



  3. #3
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Can you use FTP?

    FTP = reliable.

  4. #4
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    I think he just wants the source of a random webpage.



  5. #5
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Trevard are you there to answer my question?

  6. #6
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107
    Quote Originally Posted by lolland View Post
    Trevard are you there to answer my question?
    no i want my program to read online .txt files

  7. #7
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Mmkay then solved?

  8. #8
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    webclient.DownloadString

    i cant remember my computer is down


    but this works 100% great..

    if the web site not working it will just give u a messagebox saying it is not working
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  9. #9
    trevor206's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    324
    Reputation
    12
    Thanks
    107
    Edit:
    Solved i figured out how to get blubbs code to work.
    Last edited by trevor206; 09-24-2010 at 03:24 PM.

  10. #10
    Sydney's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Germany...
    Posts
    1,356
    Reputation
    37
    Thanks
    1,144
    My Mood
    Amused
    Global:

    Dim client As New System.Net.WebClient()

    Code:

    RichTextBox1.Text = client.DownloadString("Yorftp/notice.txt")

    Thanks Cosmos


  11. #11
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Marked solved then.
    No more posting unless 101% necessary.

Similar Threads

  1. Help (Get text from .php website) [solved]
    By BassSR in forum Visual Basic Programming
    Replies: 19
    Last Post: 09-24-2011, 03:08 AM
  2. [Request] Stream Text From Website to Form [solved]
    By Dreamer in forum Visual Basic Programming
    Replies: 7
    Last Post: 05-27-2011, 03:52 AM
  3. [Help]Reading Stacks from memory using VB.net
    By euverve in forum Visual Basic Programming
    Replies: 2
    Last Post: 04-19-2011, 10:10 AM
  4. [Help] Problem reading text from a webpage
    By Jason in forum Visual Basic Programming
    Replies: 18
    Last Post: 06-02-2010, 10:04 AM
  5. [HELP]Remove C:\ from C:\Test.txt in filename (Openfiledialog)
    By Pixie in forum Visual Basic Programming
    Replies: 1
    Last Post: 12-14-2009, 03:43 PM