4 Eylül 2015 Cuma

c# HttpWebRequest and webclient kullanımı

var http = (HttpWebRequest)WebRequest.Create("http://example.com");
var response = http.GetResponse();

var stream = response.GetResponseStream();
var sr = new StreamReader(stream);
var content = sr.ReadToEnd();
webclient  DownloadString:
var client = new WebClient();
var content = client.DownloadString("http://example.com");