Uri profileUri = new Uri(@"https://www.facebook.com/roger"); HttpWebRequest httpWebRequest = (HttpWebRequest) WebRequest.Create(profileUri); httpWebRequest.Method = WebRequestMethods.Http.Get; httpWebRequest.Proxy = null; httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2"; httpWebRequest.AllowWriteStreamBuffering = true; httpWebRequest.ProtocolVersion = HttpVersion.Version11; httpWebRequest.AllowAutoRedirect = true; httpWebRequest.KeepAlive = false; httpWebRequest.ContentType = "text/html"; httpWebRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"; using (HttpWebResponse response = (HttpWebResponse)httpWebRequest.GetResponse()) using (StreamReader sr = new StreamReader(response.GetResponseStream())) { source = sr.ReadToEnd(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)