<%
function htmlencode(string)
htmlencode=replace(string,"'","")
'htmlencode=replace(htmlencode,"=","≡")
htmlencode=replace(htmlencode,chr(13)&chr(10),"<br>")
htmlencode=replace(htmlencode," ","")
htmlencode=replace(htmlencode,"table","<br>")
'htmlencode=replace(htmlencode,"<","<")
'htmlencode=replace(htmlencode,">",">")
end function
function htmldecode(string)
htmldecode=replace(string,chr(13),"<br>")
end function
Function GetRndPassword(PasswordLen)
Dim Ran, i, strPassword
strPassword = ""
For i = 1 To PasswordLen
Randomize
Ran = CInt(Rnd * 2)
Randomize
If Ran = 0 Then
Ran = CInt(Rnd * 25) + 97
strPassword = strPassword & UCase(Chr(Ran))
ElseIf Ran = 1 Then
Ran = CInt(Rnd * 9)
strPassword = strPassword & Ran
ElseIf Ran = 2 Then
Ran = CInt(Rnd * 25) + 97
strPassword = strPassword & Chr(Ran)
End If
Next
GetRndPassword = strPassword
End Function
'**************************************************
'函数名:ReplaceBadChar
'作 用:过滤非法的SQL字符
'参 数:strChar-----要过滤的字符
'返回值:过滤后的字符
'**************************************************
Public Function ReplaceBadChar(strChar)
If strChar = "" Or IsNull(strChar) Then
ReplaceBadChar = ""
Exit Function
End If
Dim strBadChar, arrBadChar, tempChar, i
strBadChar = "',%,^,&,\\,master,cmd.exe,xp_cmdshell,declare,truncate,mid,insert,select,delete,update,count,and,modify,rename,cast,alter,create,drop,applet,script,join,union,object,exec,(,),<,>,[,],{,},/,\,;,:," & 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 IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
%>