<%
Function htmlDecode(strHTML)
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
'取闭合的<>
objRegExp.Pattern = "<.+?>"
'进行匹配
Set Matches = objRegExp.Execute(strHTML)
' 遍历匹配集合,并替换掉匹配的项目
For Each Match in Matches
strHtml=Replace(strHTML,Match.Value,"")
Next
htmlDecode=strHTML
Set objRegExp = Nothing
End Function
Function CheckCode() '用于留言中
const theNum = 4 '设置位数,修改就是了
'*************************************************************
dim strCode,theCodes,str0
theCodes = "" '初始化验证码字符
strCode = "123456789AABCDEFGHI135GGW468HJKLMNTPQRS148963TUVWR"
strCode = LCASE(strCode) '全部换成小写,当然也可不换
RANDOMIZE
for i = 1 to theNum
'循环结构重复筛选单个字符进行组合,生成theNum位的验证码
str0=mid(strCode,INT((50-1+1)*RND+1),1)
'str0为一次循环周期内经筛选的单个临时字符
theCodes = theCodes&str0 '字符叠加过程
next
if theCodes = "" then
theCodes = "9999"
end if
Session("SystemRocCode") = cstr(theCodes)
'将字符结果保存在Seesion中
CheckCode=theCodes '显示出验证字符
End Function
%>