去html标签

  public static string GetHtmlText(string html)
        {
            try
            {
                HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
                doc.LoadHtml(html);
                return doc.DocumentNode.InnerText;
            }
            catch
            {
                return null;
            }
        }

 

使用第三方控件HtmlAgilityPack

posted @ 2012-09-12 09:59  南潇湘  阅读(168)  评论(0编辑  收藏  举报