Monday, November 23, 2009

ViewSource of an URL

using System.Net;


public string getURLSource(string strUrl)
{
WebClient webClient = new WebClient();
byte[] reqHTML;
reqHTML = webClient.DownloadData(strUrl);
UTF8Encoding objUTF8 = new UTF8Encoding();
string str = objUTF8.GetString(reqHTML);
return str;
}

No comments: