Return to Snippet

Revision: 61133
at November 30, 2012 08:30 by jprochazka

Initial Code
string url = "";
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = sr.ReadToEnd();

Initial URL

Initial Description
Assigns the contents of a "url" to the string variable "result".

Initial Title
Read an external url into a string variable.

Initial Tags

Initial Language