This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ReadPageContentFromUrl(string url) | |
{ | |
WebClient client = new WebClient (); | |
Stream data = client.OpenRead(url); | |
StreamReader reader = new StreamReader(data, Encoding.UTF8); | |
string html = reader.ReadToEnd(); | |
Encoding encFrom = Encoding.GetEncoding(readCharactersetFromHTML(html)); | |
html = ChangeEncoding(encFrom, Encoding.UTF8, html); | |
data.Close (); | |
reader.Close(); | |
return html; | |
} |
No comments:
Post a Comment