一个过滤广告的函数

Posted on 2005-07-09 16:03  flourish  阅读(203)  评论(0)    收藏  举报
Function WordFilter(Str) 
 Dim MatchNum,MatchKey 
 MatchNum = 0 
 For i=1 To Len(Str) 
 MatchKey=LCase(Mid(Str,i,4)) 
 If MatchKey="href" Or MatchKey="[url" Or MatchKey="http" Then MatchNum=MatchNum+1 
 If MatchNum>3 Then Exit For 
 Next 
 If MatchNum>3 Then AlertTo Referer,"嘿嘿~ 不要告诉我你不是在贴广告啊,(这里是你的粗口)!" 
 WordFilter = Str 
End Function  

短小实用!!!

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3