Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

È¥³ýÍøÕ¾ÖÐHTML±êÇ©µÄÕýÔò±í´ïʽ

string str = a.ToString();
str = Regex.Replace(str, @"</?span[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"&#[^>]*;", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?marquee[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?object[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?param[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?embed[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?table[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @" ","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?tr[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?th[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?p[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?a[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?img[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?tbody[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?li[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?span[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?div[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?th[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?td[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?script[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"(javascript|jscript|vbscript|vbs):", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"on(mouse|exit|error|click|key)", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"<\\?xml[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"<\/?[a-z]+:[^>]*>", "", RegexOptions.Ignore


Ïà¹ØÎĵµ£º

c#´ÓhtmlÖлñȡͼƬµØÖ·

 
using System.Text.RegularExpressions;
string ohtml = this.TextBox1.Text;
            System.Text.RegularExpressions.MatchCollection m;
            //ÌáÈ¡×Ö·û´®µÄͼƬ
   ......

XHTMLºÍHTMLµÄÇø±ð

ÒòΪWap2.0ʹÓÃXHTMLÓïÑÔ²¢¼æÈÝWML£¬ÒÔÏÂÊÇÍøÉÏÕÒµÄXHTMLºÍHTMLµÄÇø±ð
XHTMLÏà±ÈÓÚHTML
  1.ËùÓеıê¼Ç¶¼±ØÐëÒªÓÐÒ»¸öÏàÓ¦µÄ½áÊø±ê¼Ç
  ÒÔǰÔÚHTMLÖУ¬Äã¿ÉÒÔ´ò¿ªÐí¶à±êÇ©£¬ÀýÈçºÍ<li>¶ø²»Ò»¶¨Ð´¶ÔÓ¦µÄ
  ºÍ</li>À´¹Ø±ÕËüÃÇ¡£µ«ÔÚXHTMLÖÐÕâÊDz»ºÏ·¨µÄ¡£XHTMLÒªÇóÓÐÑϽ÷µÄ½á¹¹£¬ËùÓбêÇ©±ØÐë ......

HtmlÖÐfieldset±êÇ©Ó÷¨

͹Ï߱߿ò(¿í¶È10,ºìÉ«)
·Ö×é¿ò¡¡ ´úÂë
<fieldset style="border:10px ridge #FF0000; padding:2px; width:500">
<legend>·Ö×é¿ò</legend>
¡¡</fieldset>
°¼Ïß
·Ö×é¿ò¡¡ ´úÂë
<fieldset style="border:10px groove #FF0000; padding:2px; width:500">
<legend>·Ö×é¿ò</legen ......

ʹÓÃPerlµÄHTML::TreeBuilder::XPathÀ´½âÎöÍøÒ³ÄÚÈÝ

Ô­ÎĵØÖ·£ºhttp://www.php-oa.com/2009/09/24/perl-html-tree-builder-xpath.html
ת¹ýÀ´ ÂýÂýÑо¿
Ç¿´óµÄPerlÖÐ,Óг¬¼¶¶àÇ¿´óµÄÄ£¿é,ÈÃÎÒÃDz»ÔÚÐèÒªÖØ¸´µÄ·¢Ã÷ÂÖ×Ó.ÏÂÃæÕâ¸ö¾ÍÊÇÒ»¸öÇ¿´óµÄÄ£¿é.HTML::TreeBuilder::XPath.ËüÄÜÏóxmlÒ»Ñù½âÎöÍøÕ¾.ÔõôʹÓþͲ»Ï¸½²ÁË,ÈçÏÂ,¼ûʵÀý,ÎÒÊÇ´Óalexa.comÍøÕ¾µÃµ½ÎÒµÄÍøÕ¾ÅÅÃûµÄÒ» ......

StrutsÖÐhtml±êÇ©µÄÓ÷¨

±êÇ©ÓÃÓÚÉú³ÉÒ»¸öHTML form¡£Ê¹Óøñêǩʱ±ØÐë×ñÑ­Ðí¶à¹æÔò¡£
Ê×ÏÈ£¬±êÇ©ÖбØÐë°üº¬Ò»¸öactionÊôÐÔ£¬ËüÊÇÕâ¸ö±êÇ©ÖÐΨһ±ØÐèµÄÊôÐÔ¡£Èç¹û²»¾ß±¸¸ÃÊôÐÔÔòJSPÒ³Ãæ»áÅ׳öÒ»¸öÒì³£¡£Ö®ºóÄã±ØÐë¸øÕâ¸öactionÊôÐÔÖ¸¶¨Ò»¸öÓÐЧֵ¡£Ò»¸öÓÐЧֵÊÇÖ¸Ó¦ÓóÌÐòµÄStrutsÅäÖÃÎļþÖÐÔªËØÀïµÄÈκÎÒ»¸ö×ÓÔªËØµÄ·ÃÎÊ·¾¶¡£¶øÇÒÏàÓ¦µÄÔªËØÖб ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ