Ò»¸öASPÌæ»»º¯ÊýimgÀïÃæ¶àÓàµÄ´úÂë
<%
Response.Write(Server.HTMLEncode(FixImg("<img onclick=""if(this.width>screen.width-461) window.open('qq/20082181405371.jpg');"" alt="""" border=""0"" src=""qq/20082181405371.jpg"" />")))
%>
<%
'¹¦ÄÜ:½«IMG´úÂë¸ñʽ»¯Îª<img src="XXX" />¸ñʽ.
Function FixImg(sString)
Dim sReallyDo, regEx, iReallyDo
Dim oMatches, cMatch
Dim tStartTime, tEndTime
If IsNull(sString) Then
FixImg = ""
Exit Function
End If
sReallyDo = sString
On Error Resume Next
sReallyDo = Replace(sReallyDo, vbCr, " ")
sReallyDo = Replace(sReallyDo, vbLf, " ")
sReallyDo = Replace(sReallyDo, vbTab, " ")
sReallyDo = Replace(sReallyDo, "<img ", vbCrLf & "<img ", 1, -1, 1)
sReallyDo = Replace(sReallyDo, "/>", " />", 1, -1, 1)
sReallyDo = ReplaceAll(sReallyDo, "= ", "=", True)
sReallyDo = ReplaceAll(sReallyDo, "> ", ">", True)
sReallyDo = Replace(sReallyDo, "><", ">" & vbCrLf & "<")
sReallyDo = Trim(sReallyDo)
On Error GoTo 0
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
'//È¥³ýonclick,onloadµÈ½Å±¾
regEx.Pattern = "\s[on].+?=([\""|\'])(.*?)\1"
sReallyDo = regEx.Replace(sReallyDo, "")
'//½«SRC²»´øÒýºÅµÄͼƬµØÖ·¼ÓÉÏÒýºÅ
regEx.Pattern = "<img.*?\ssrc=([^\""\'\s][^\""\'\s>]*).*?>"
sReallyDo = regEx.Replace(sReallyDo, "<img src=""$1"" />")
'//ÕýÔòÆ¥ÅäͼƬSRCµØÖ·
regEx.Pattern = "<img.*?\ssrc=([\""\'])([^\""\']+?)\1.*?>"
sReallyDo = regEx.Replace(sReallyDo, "<img src=""$2"" />")
FixImg = sReallyDo
End Function
%>
<%
'¹¦ÄÜ£º·µ»Ø×Ö·û´®£¬ÆäÖÐÖ¸¶¨ÊýÄ¿µÄij×Ó×Ö·û´® È«²¿ ±»Ì滻ΪÁíÒ»¸ö×Ó×Ö·û´®¡£
'À´Ô´£ºhttp://jorkin.reallydo.com/article.ASP?id=406
'ÐèÒªBintº¯Êý:http://jorkin.reallydo.com/article.ASP?id=395
Function ReplaceAll(sExpression, sFind, sReplaceWith, bAll)
If IsNull(sExpression) Then ReplaceAll = "" : Exit Function
If (StrComp(bAll, "True", 1) = 0) Or (CBool(Bint(