TextBox ³¬Á´½ÓÌæ»»³ÉHTML³¬Á´½ÓÐÎʽ
string tent = this.TextBox_info.Text.Replace("<", "<").Replace(">", ">").Replace(" ", " ").Trim().Replace("\n", "<br/>");
Regex regex = new Regex(@"(?:https?://|www\.)(?:[\w-]+\.)+[\w-]+(?:/[\w- ./?%&=]*)?", RegexOptions.ECMAScript);
MatchCollection mc = regex.Matches(tent);
string text = "";
List<string> list = new List<string>();
foreach (Match m in mc)
{
list.Add(m.ToString());
}
for (int i = 0; i < list.Count; i++)
{
for (int j = i + 1; j < list.Count; j++)
{
if (list[i] == list[j])
{
list.Remove(list[j]);
&
Ïà¹ØÎĵµ£º
Ô´ÎÄ£ºhttp://www.pconline.com.cn/pcedu/sj/wz/html/0401/293106.html
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£meta ±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£meta µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕ ......
ÍøÕ¾ÓÅ»¯
³£ÓõÄHTML±êÇ©:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<body>
<h1>H1±êÇ©£¬¶¨ÒåÎÄÕ±êÌ⣬һ¸öÒ³ÃæÖ»ÒªÒ»¸ö</h1>
<h2>H2±êÇ©£¬¶¨ÒåÎÄÕ±êÌ⣬һ¸öÒ³ÃæÖ»ÒªÒ ......
Ò»ÖÖ£º
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>¼æÈÝFireFoxµÄµ±Ç°Ê±¼äµÄJS½Å±¾</title>
</head>
<body>
<DIV id=time>µ±Ç°Ê±¼ä
<SCRIPT>document.getElementById('time').innerHTML=new Date().toLo ......
using System.Text.RegularExpressions; //ÒýÈëµÄÃüÃû¿Õ¼ä
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
//Çå³ýHTMLº¯Êý
public static string NoHTML(string Htmlstring)
{
//ɾ³ý½Å±¾
Htmlstr ......