I'm trying to get html source of a webpage by using WebRequest Class. It works completely fine in most cases but with this specific website ,however, the resulted string is totally meaningless.
static void Func()
{
WebRequest wr = WebRequest.Create(url);
wr.ContentType = "text/html";
wr.UseDefaultCredentials = true;
WebResponse response = wr.GetResponse();
string s;
using (StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8, true))
{
s = sr.ReadToEnd();
}
using (StreamWriter sw = File.CreateText(@"./test.txt"))
{
string[] lines = s.Split(Environment.NewLine);
foreach (var line in lines)
{
sw.WriteLine(line);
}
}
response.Close();
}
and the result is the test.txt file containing text lines like :
"붿嵪뿯庽붿뿯岽獛윛纕問뿯쎽怞ȍ붿뿯붿뿯Ⓗ뿯붿뿯붿붿뿯疽붿붿〡붿ㄅ〴뿯붿붿뿯撽뿯撽뿯붿붿뿯붿퉚";
I've already used different encoders and yet nothing worked. This is the website link : "http://www.tsetmc.com/loader.aspx?ParTree=151311&i=33854964748757477"