Reading from a text file on your local computer is easy, but surely using a URL to point to a different location should work too?
The code I have thus far is as follows
1. using System;
2. using System.IO;
3.
4. namespace csharp_station.howto
5. {
6. class TextFileReader
7. {
8. static void Main(string[] args)
9. {
10. // create reader & open file
11. TextReader tr = new StreamReader("http://jamesgeddes.com/wttr.txt");
12.
13. // read a line of text
14. Console.WriteLine(tr.ReadLine());
15.
16. Console.WriteLine("Enter your name");
17. string s7 = Console.ReadLine();
18. Console.WriteLine("Hello, {0}!", s7);
19. // close the stream
20. tr.Close();
21. }
22. }
23. }
However when I this runs the "ArgumentException was unhandled" box pops up and says "URI formats are not supported."
All I want to do is read the contents of that text file, use it as the value of a variable or array and display it on the console. Is this possible?