Hi everybody,
I have a web page where i want to get the html source of another web page. This web page is: http://s1.viastreaming.net:8000/7.html, you can see that i only want to know the name of a song.
I try to put in my page these lines to get the html source:
protected string ObtenerWeb()
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://s1.viastreaming.net:8000/7.html");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader StreamRead = new StreamReader(resStream);
string Contenido = StreamRead.ReadToEnd().ToString();
return Contenido;
}
And i have to add these lines in my web.config, because when they aren't in my web.config the server returns me this error: "The server committed a protocol violation. Section=ResponseStatusLine". I solve this problem adding these lines:
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
Ok, now I can get the response without errors, but i only can read bad characters. For example: "(In7%7GSOZ*x:2X_O\0_`߰X8E/\a՟籬\0($0E'\0՛jeB=JXzIr-!ZVOЮ)znbJ.]Xޡ7H|.f鳼Aq"
I think that the problem is with the codification, but i don't know how i can solve it, Do you know?
for a better development...