去除字符串中的Html代码
/// <summary>
/// 去掉所有HTML标签
/// </summary>
/// <param name="strHtml">源字符串</param>
/// <returns></returns>
public static string DropHTML(string strHtml)
{
return Regex.Replace(strHtml, "<[^>]*>", "");
}
相关文档:
HTML有10个表格相关标签。下面是一个带有简介的列表,但是首先,文档要被正确的定义在HTML 4.01/XHTML 1或HTML 5下面:
<caption> 定义表格标题(4, 5)
<col> 为表格的列定义属性(4, 5)
<colgroup> 定义表格列的分组(4, 5)
<table> 定义表格(4, 5)
<tbody> 定义表格主体(4, 5)
< ......
第一种:
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>
第二种:
<script language="javascript">
alert("返回");
window.history.back ......
直接封装成一个类的,用起来还挺方便的
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text ......
<p>: 格式化段落; <h1>,<h6> 标题; <blockquote>-- 引用的文本; <pre>--预先格式化好的文本;保留原有的格式.
<ol><dl><ul>:顺序列表,定义列表,无标号列表. <li>用以显示单个的元素; <dl><dt><dd></dd></dt><dl>
< ......
string tent = this.TextBox_info.Text.Replace("<", "<").Replace(">", ">").Replace(" ", " ").Trim().Replace("\n", "<br/>");
& ......