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();
Written by Ion D. Filho
Related protips
1 Response
can you give more information about this because I'm new to this thing.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#