<% function ReplaceHTMLContent(s) dim r r = replace(s,"<","<") ReplaceHTMLContent = r end function function ReplaceTextContent(s) dim r r = replace(s,"<","〈") r = replace(s,">","〉") ReplaceTextContent = r end function Function HTMLEncode(fString) fString=replace(fString,";",";") fString=replace(fString,"<","<") fString=replace(fString,">",">") fString=replace(fString,"\","\") fString=replace(fString,"--","--") fString=replace(fString,CHR(9)," ") fString=replace(fString,CHR(10),"
") fString=replace(fString,CHR(13),"") fString=replace(fString,CHR(22),"") fString=replace(fString,CHR(32)," ") fString=replace(fString,CHR(34),""")'双引号 fString=replace(fString,CHR(39),"'")'单引号 HTMLEncode=fString End Function function SafeRequestStr(para) SafeRequestStr= replace(para,"'","''") end function function SafeRequestDelSpace(para) dim str str = request(para) & "" SafeRequestDelSpace= replace(str," ","") end function function SafeRequestIsNum(para) dim str str = request(para) & "" if isnumeric(str) then SafeRequestNum= para else SafeRequestNum= "0" end if end function Function ClearHtml(Content) Content=Zxj_ReplaceHtml("&#[^>]*;", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml(" ","",Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("(javascript|jscript|vbscript|vbs):", "", Content) Content=Zxj_ReplaceHtml("on(mouse|exit|error|click|key)", "", Content) Content=Zxj_ReplaceHtml("<\\?xml[^>]*>", "", Content) Content=Zxj_ReplaceHtml("<\/?[a-z]+:[^>]*>", "", Content) Content=Zxj_ReplaceHtml("]*>", "", Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) Content=Zxj_ReplaceHtml("]*>","",Content) ClearHtml=Content End Function Function Zxj_ReplaceHtml(patrn, strng,content) IF IsNull(content) Then content="" End IF Set regEx = New RegExp ' 建立正则表达式。 regEx.Pattern = patrn ''设置模式。 regEx.IgnoreCase = true '设置忽略字符大小写。 regEx.Global = True '设置全局可用性。 Zxj_ReplaceHtml=regEx.Replace(content,strng) '执行正则匹配 End Function %>