Last Updated: February 25, 2016
·
8.216K
· iondrimba

Read text/xml file via C# over HTTP and get its content

//namespace
using System.Net;

string fileLocation = "http://site/file.txt"; ( could also be a xml file )

WebClient client = new WebClient();
Stream stream = client.OpenRead(fileLocation);
StreamReader reader = new StreamReader(stream);
String content = reader.ReadToEnd();

1 Response
Add your response

can you give more information about this because I'm new to this thing.

over 1 year ago ·