Home ยป ASP.net | C# | DotNet

Parse Website Sniplet via C#

3. June 2010 by Administrator 0 Comments

Here is the code - sniplet i use for parsing a website. hope you like it.

public static string HttpWebParse(string url)
        {
            string str;
            try
            {
             
                string address = url;
                byte[] bytes = new WebClient().DownloadData(address);
                str = Encoding.Default.GetString(bytes);
            }
            catch (WebException exception1)
            {
                WebException exception = exception1;
                return exception.Message;

            }
            return str;
        }

blog comments powered by Disqus