c#´ÓhtmlÖлñȡͼƬµØÖ·
using System.Text.RegularExpressions;
string ohtml = this.TextBox1.Text;
System.Text.RegularExpressions.MatchCollection m;
//ÌáÈ¡×Ö·û´®µÄͼƬ
m = Regex.Matches(ohtml, "(<img).*?>");
for (int i = 0; i < m.Count; i++)
{
string ostr = m[i].ToString();
//ÌáȡͼƬµÄµØÖ·
System.Text.RegularExpressions.MatchCollection m2;
m2 = Regex.Matches(ostr, "(src=)['|\"].*?['\"]");
for (int j = 0; j < m2.Count; j++)
{
string strTemp = m2[j].ToString();
strTemp = strTemp.Replace("src=", "");
strTemp = strTemp.Replace("\"", "");
strTemp = strTemp.Replace("'", "");
 
Ïà¹ØÎĵµ£º
function unhtml($content){
$content=htmlspecialchars($content);
$content=str_replace(chr(13),"<br>",$content);
$content=str_replace(chr(32)," ",$content);
return trim($content);
}
......
HTML×Ö·ûʵÌå(Character Entities)
ÓÐЩ×Ö·ûÔÚHTMLÀïÓÐÌØ±ðµÄº¬Ò壬±ÈÈçСÓÚºÅ<¾Í±íʾHTML TagµÄ¿ªÊ¼£¬Õâ¸öСÓÚºÅÊDz»ÏÔʾÔÚÎÒÃÇ×îÖÕ¿´µ½µÄÍøÒ³ÀïµÄ¡£ÄÇÈç¹ûÎÒÃÇÏ£ÍûÔÚÍøÒ³ÖÐÏÔʾһ¸öСÓںţ¬¸ÃÔõô°ìÄØ£¿
Õâ¾ÍҪ˵µ½HTML×Ö·ûʵÌå(HTML Character Entities)ÁË¡£
Ò»¸ö×Ö·ûʵÌå(Character Entity)·Ö³ÉÈý²¿·Ö£ºµÚÒ»²¿· ......
<select name="CluefromType" id="CluefromType" style="width: 182px" onchange="return CluefromOtherTypeSelected();">
<option value="Êг¡×ß·Ã">
Êг¡×ß·Ã
< ......
ʹÓÃTWebBrowser×é¼þ±£´æÍøÒ³ÎªhtmlºÍmhtÎļþ ÊÕ²Ø
Ò»¡¢±£´æÎªHTMLÎļþ
uses ActiveX;
...
procedure WB_SaveAs_HTML(WB : TWebBrowser; const FileName : string) ;
var
PersistStream: IPersistStreamInit;
Stream: IStream;
FileStream: TFileStream;
begin
if not Assigned(WB. ......