Reading text files on the internet
Can anyone tell me how to read a text file or a picture on the internet? For example, I want to compare the data in a string called "data", with a text file, for example, located at http://www.textfiles.com/text.txt. How would I go about downloading the text file into a string? I can do this locally with a file on my computer using:
Like I said, this works for local files, so how can I modify this to read the file online instead?
using (FileStream fs = File.Open(user, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
byte b = new byte;
UTF8Encoding temp = new UTF8Encoding(true);
while (fs.Read(b, 0, b.Length) > 0)
tmp += (temp.GetString(b));