using System.IO; using System.Net.Http; using System.Threading.Tasks;
Create a function in the Program.cs file that will return a StreamReader from the specified URL. Because in this case it will be used inside the Main method which is static, the new function will also have to be static.
Inside the function, we return a StreamReader which is instantiated by creating an HTTPClient and asynchronously executing a GET request which returns a Task<StreamReader>. In order to resolve the object, the Result property needs to be requested.
Reading File Contents
Replace the contents of the Main method with the following