Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

parsing html

$
0
0

hi actually have this for parsing my html:

        public string GetPage()
        {
            string Url = ConfigurationSettings.AppSettings["Url"].ToString();
            try
            {
                string pagina = "";
                WebRequest request = WebRequest.Create(Url);

                WebResponse response = request.GetResponse();

                // Abrir el stream de la respuesta recibida.
                StreamReader reader =
                    new StreamReader(response.GetResponseStream());

                string res = reader.ReadToEnd();

                pagina = res;
                reader.Close();
                response.Close();
                return pagina;
            }
            catch (Exception x)
            {
                Console.WriteLine(x.Message);
                Console.ReadLine();
                return "";
            }
        }

but throw this exception:

Error 500 internal serve error.

Any Help me¡


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>