Return to Snippet

Revision: 61475
at December 15, 2012 08:47 by jprochazka


Initial Code
public string getHtml(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();
    sr.Close();
    myResponse.Close();
    return result;
}

Initial URL


Initial Description
Returns the entire markup making up the specified webpage.

Initial Title
Get Entire Markup For The Supplied URL.

Initial Tags


Initial Language
C#