Loading .TXT from web

Darc

Well-known member
Joined
Apr 18, 2003
Messages
89
I just wanna load a text file from a website, so I can quickly update the News Screen on a game Im working on. I dont have any database tools so text is gonna hafta do. I tried something like:

Dim sr as new StreamReader(*insert address of TXT here*)

but it gave my a URI Encoding is not Supported error. Any help?
 
You could use the System.Net.WebClient class which can download a file for you.
Code:
Dim wc As New System.Net.WebClient
wc.DownloadFile("address of the file", "path at which to save it")
And then read it. Or if you prefer use the DownloadData method instead of DownloadFile.
 
Back
Top