Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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;
            //ÌáÈ¡×Ö·û´®µÄͼƬ
   ......

html ³¬Á´½Ó a ÊôÐÔ

html ³¬Á´½Ó ÊôÐÔ
HTML ʹÓ󬼶Á´½ÓÓëÍøÂçÉϵÄÁíÒ»¸öÎĵµÏàÁ¬¡£
ê±êÇ©ºÍ Href ÊôÐÔ
HTML ʹÓà <a> £¨Ãª£©±êÇ©À´´´½¨Á¬½ÓÁíÒ»¸öÎĵµµÄÁ´½Ó¡£
ê¿ÉÒÔÖ¸ÏòÍøÂçÉϵÄÈκÎ×ÊÔ´£ºÒ»ÕÅ HTML Ò³Ãæ£¬Ò»·ùͼÏñ£¬Ò»¸öÉùÒô»òÊÓÆµÎļþµÈµÈ¡£
´´½¨ÃªµÄÓï·¨£º
<a href="url">Text to be displayed</a>
ÀýÈ磺
& ......

ʹÓÃperl·ÖÎöhtmlÎļþ

Ô­ÎĵØÖ·£ºhttp://bbs.chinaunix.net/viewthread.php?tid=1316204
ǰÌìÑо¿Ê¹ÓÃHTML::TreeBuilderÄ£¿é·ÖÎöÍøÒ³£¬¿´µ½ÁËһƪÎÄÕ£¬Ë³±ã¾Í·­ÒëÁËһϣ¬·¢ÉÏÀ´·ÖÏí¡£±¾ÈËÎıʲ»ºÃ£¬eÎÄˮƽÓÐÏÞ£¬´ó¼Ò´éºÏ¿´°É¡£
Ô­ÎĵØÖ·£ºhttp://www.perl.com/pub/a/2006/01/19/analyzing_html.html?page=1
ÎÄÕµı³¾°ÊÇ£¬×÷ÕßÔÚ½ÌÊÚÍøÒ³ ......

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

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

jsForm Html Form via JSON with jQuery

/* 1 construct html form 2 bind data to form 3 validate form data 4 collect data from form */  (function($){     var controlTypes = ['textbox','password',' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ