Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I just wanna load a text file from a website, so I can quickly update the News Screen on a game I'm working on. I don't 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?

  • *Experts*
Posted

You could use the System.Net.WebClient class which can download a file for you.

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...