在winform中解析html标签
最近在弄公司的系统时遇到一个问题,有一个winform要调用网站的数据库,数据库中存的是经过eWebEditor处理过的文章,都带有html标签,当时想用正则表达式过滤掉,但是还是放弃了原因有三:1.我对正则表达式了解很少;2.虽说我可以现学正则表达式,但是实现起来也是很麻烦的;3.如果过滤掉的话文章的格式就没有了。于是上网找这方面的控件,不是很理想。最后在百度知道上100分悬赏找到了解决方法,很简单的,不需要第三方控件,直接用WebBrower就能实现,用到了WebBrower.DocumentText属性,比如要显示的html代码如下:adc</br>def,则可用下面方法解析显示:
string str = "abc</br>def"; //实际是数据库中的文章
WebBrower.DocumentText = str; //显示
相关文档:
下面是一个过滤html元素的程序,也许对大家有点帮助!
/**
* filter all html element.
* For example:<a href="www.sohu.com/test">hello!</a>
* The filter result is :hello!
  ......
html 网页描述语言
html的基本框架
<head> //标签头
<javacript> &nb ......
先来看段代码:
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>
<head>
<title>标题<title>
</head>
<body>..........文件内容..........
</body>
</html>
1.文件标题
<title>..........</title>
2.文件更新--<meta>
【1】10秒后自动更新一次
<meta http-equiv="refresh" content=10>
【2】10秒後自动连结到另一文件
......
前台 <form id="form1" runat="server" enctype="multipart/form-data">
<input type="flie" id="xxx">
</form>
后台通过 HttpPostedFile f = Request.Files["xxx"]
接收就可以了 ......