<%
'过滤文字
Function ChkBadWords(fString)
  bwords = split(BadWords, "|")
  For i = 0 to ubound(bwords)
    fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"), 1,-1,1) 
  Next
  ChkBadWords = fString
  'strContent=ChkBadWords(strContent)
End Function

Rem 过滤HTML代码
function HTMLEncode(fString)
mString = fString
if not isnull(mString) then
    mString = replace(mString, ">", "&gt;")
    mString = replace(mString, "<", "&lt;")
    mString = Replace(mString, CHR(32), "&nbsp;")
    mString = Replace(mString, CHR(9), "&nbsp;")
    mString = Replace(mString, CHR(34), "&quot;")
    mString = Replace(mString, CHR(39), "&#39;")
    mString = Replace(mString, CHR(13), "")
    mString = Replace(mString, CHR(10) & CHR(10), "</P><P> ")
    mString = Replace(mString, CHR(10), "<BR> ")
    'fString=ChkBadWords(fString)
    HTMLEncode = mString
end if
end function


'过滤HTML代码2
function HTMLEncode2(fString)

    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")
    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    'fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
    'fString = Replace(fString, CHR(10), "<BR> ")
    HTMLEncode2 = fString

end function


'过滤表单字符
function HTMLcode(fString)
if not isnull(fString) then
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
    fString = Replace(fString, CHR(10), "<BR>")
    HTMLcode = fString
end if
end function

'过滤SQL非法字符
Function ReplaceBadChar(strChar)
		If strChar = "" Or IsNull(strChar) Then ReplaceBadChar = "":Exit Function
		Dim strBadChar, arrBadChar, tempChar, I
		strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""
		arrBadChar = Split(strBadChar, ",")
		tempChar = strChar
		For I = 0 To UBound(arrBadChar)
			tempChar = Replace(tempChar, arrBadChar(I), "")
		Next
		ReplaceBadChar = tempChar
End Function

function Del(purl) 
on error resume next 
dim fso 
set fso=server.CreateObject("Scripting.FileSystemObject")   
fso.DeleteFile server.MapPath(purl),true    
set fso=nothing 
end function


'删除文件夹

function DeleteFolder(Folder)
on error resume next
Folder=server.MapPath(Folder)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
if FSO.FolderExists(Folder) then
  FSO.Deletefolder Folder,true
end if
if err>0 then 
  err.clear
  Deletefolder=False
else
  Deletefolder=True
end if
end function


function Deleteshu(Folder)
on error resume next
	Dim myRegExp, ResultString '定义
	Set myRegExp = New RegExp '声明对象
	myRegExp.Global = True '设置全局应用
	myRegExp.Pattern = "[<][^<]*[>]" '设置正则表达式
	Deleteshu = myRegExp.Replace(Folder, "") '替换内容
end function
%>