<%
Function LoseHTML(strHTML)
On Error Resume Next
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
strHTML = strHTML & ""
if strHTML="" Then LoseHTML="":Exit Function
strOutput = objRegExp.Replace(strHTML, "")
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
strOutput = Replace(strOutput, " ", "")
strOutput = Replace(strOutput, "•", "·")
LoseHTML = Trim(strOutput)
Set objRegExp = Nothing
End Function
Public Function Checkstr(Str)
If Isnull(Str) or str = "" Then
CheckStr = ""
Exit Function
End If
Str = Replace(Str,Chr(0),"")
Str = Replace(Str,Chr(10),"")
Str = Replace(Str,Chr(13),"")
CheckStr = Replace(Str,"'","''")
End Function
Rem 空字段则赋值为零长度字符串
Function ChkIsNull(str)
If IsNull(str) then
ChkIsNull = ""
Else
ChkIsNull = str
End If
End Function
function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")
if InStr(strUrl,"&")
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
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
Function getver(Classstr)
On Error Resume Next
getver=""
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(Classstr)
If 0 = Err Then getver=xtesTobj.version
Set xTestObj = Nothing
Err = 0
End Function
'*************************************
'反转换HTML代码
'*************************************
Function HTMLDecode(ByVal reString)
Dim Str:Str=reString
If Not IsNull(Str) Then
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, " ", CHR(9))
Str = Replace(Str, " ", CHR(9))
Str = Replace(Str, "'", CHR(39))
Str = Replace(Str, """, CHR(34))
Str = Replace(Str, "", CHR(13))
Str = Replace(Str, "
", CHR(10) & CHR(10))
Str = Replace(Str, "
", CHR(10))
HTMLDecode = Str
End If
End Function
Function HTMLEncode(ByVal fString)
If Not IsNull(fString) Then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
HTMLEncode = fString
End If
End Function
Function ServerHTMLEncode(ByVal str)
If Not IsNull(str) Then
ServerHTMLEncode = Server.HTMLEncode(str)
Else
ServerHTMLEncode = ""
End If
End Function
Sub MsgBox(str, stype, ac)
response.write "<script>"
If chkisnull(str)<>"" Then
response.write "alert('"&str&"');"
End If
select case stype
case "back"
response.write "history.go(-1);"
case "gourl"
response.write "window.location='"&ac&"';"
case "close"
response.write "window.opener=self;window.close();"
Case Else
response.write ac
end select
response.write "</script>"
response.write "