URL's and RTB

  • Thread starter Thread starter robid1
  • Start date Start date
R

robid1

Guest
OK, im real new to visual basic so be kind. I would like some advice on how to make a button be able to 'fetch' a txt file on the web, and display that in a rich text box, as you can see, nothing too hard for someone with experience. Im using VB .NET, just for personal use id really apreciate anyone that wants to help.

Cheers.
 
You are going to want to use the DownloadFile method of the
WebClient class. Look in the .NET Framework references for
examples of how to use it, and a listing of its memebers.

You will have to download it to a text file, open the text file for
reading, and read it into the RTB.

Here is a little clip from the help file about the class:
The WebClient class also provides three methods for downloading data from a resource:

DownloadData downloads data from a resource and returns a byte array.
DownloadFile downloads data from a resource to a local file.
OpenRead returns the data from the resource as a Stream.

Good luck.
 
Surely DownloadData would be more appropriate, as it doesn't require writing to a file first?
 
Back
Top