C#获取html中纯文本
/// <summary>
/// 获取html中纯文本
/// </summary>
/// <param name="html">html</param>
/// <returns>纯文本</returns>
public static string GetHtmlText(string html)
{
html = System.Text.RegularExpressions.Regex.Replace(html, @"<\/*[^<>]*>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
html = html.Replace("\r\n", "").Replace("\r", "").Replace(" ", "").Replace(" ", "");
return html;
}