Skip to content

Instantly share code, notes, and snippets.

@ahmetilgin
Created October 15, 2016 15:59
Show Gist options
  • Select an option

  • Save ahmetilgin/e6deafb1b9a646e173cb289bdb6f7dae to your computer and use it in GitHub Desktop.

Select an option

Save ahmetilgin/e6deafb1b9a646e173cb289bdb6f7dae to your computer and use it in GitHub Desktop.
string urlAddress = "http://google.com";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = null;
if (response.CharacterSet == null)
{
readStream = new StreamReader(receiveStream);
}
else
{
readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
}
string data = readStream.ReadToEnd();
response.Close();
readStream.Close();
}
@ahmetilgin

Copy link
Copy Markdown
Author

Arkadaşlar bu kod html parse edip okuyor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment