public static string Download(string url)
{
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream stream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(stream, Encoding.ASCII);
return streamReader.ReadToEnd();
}
A halfhearted blog about one guys experiences and thoughts with a few code snips thrown in. Includes topics such as travel, motorcycles, programming, New York City, and anything that interests me enough to document.
Tuesday, January 5, 2010
Simple method to download Web resource
Had to look this up - again - so writing a quick note for future reference.