去除HTML格式 截取字符串
//截取部分内容方法
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// 去除HTML标记
if (strValue.Length > length)
{
return strValue.Substring(0, length) + "...";
}
else
{
return strValue;
}
}
#region 回车,空格过滤
/**/
/// <summary>
/// 去除HTML标记
/// </summary>
/// <param name="NoHTML">包括HTML的源码 </param>
/// <returns>已经去除后的文字</returns>
public static string NoHTML(string Htmlstring)
{
//删除脚本
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "",
RegexOpti
相关文档:
先来看段代码:
document.domain = 'ray.com';
这段代码到底是什么意思呢?
首先,我们来看下HTML DOM 关于这个的说明:
domain of type DOMString, readonlyThe domain name of the server that served the document, or null if the server cannot be identified by a domain name.
这段话的意思是这个值是DO ......
<html:html>标签有一个 lang 属性,用于显示用户使用的语言:
<html:html lang="true">
如果客户浏览器使用中文,那么以上代码在运行时将被解析为普通的 HTML 代码:
<html lang="zh-CN">
解释:当 lang 属性为 "true ......
前台 <form id="form1" runat="server" enctype="multipart/form-data">
<input type="flie" id="xxx">
</form>
后台通过 HttpPostedFile f = Request.Files["xxx"]
接收就可以了 ......
<map name="Map4" id="Map4">
<area shape="rect" mce_shape="rect" coords="659,31,697,45" mce_coords="659,31,697,45" href="product/?keys=289" mce_href="product/?keys=289" />
</map>
<map name=" ......