======================================
Public Function ReadTopic(ByVal str, ByVal strLen)
Dim l, t, c, i
On Error Resume Next
str = Replace(str, " ", " ")
If Len(str) < strLen Then
str = str & String(strLen - Len(str), ".")
Else
str = str
End If
l = Len(str)
t = 0
For i = 1 To l
c = Abs(Asc(Mid(str, i, 1)))
If c > 255 Then
t = t + 2
Else
t = t + 1
End If
If t >= strLen Then
ReadTopic = Left(str, i) & "..."
Exit For
Else
ReadTopic = str & "..."
End If
Next
End Function
''================================================
''函数名:strLength
''作 用:计字符串长度
''参 数:str ----字符串
''================================================
Public Function strLength(ByVal str)
On Error Resume Next
If IsNull(str) Or str = "" Then
strLength = 0
Exit Function
End If
Dim WINNT_CHINESE
WINNT_CHINESE = (Len("例子") = 2)
If WINNT_CHINESE Then
Dim l, t
Dim i, c
l = Len(str)
t = l
For i = 1 To l
c = Asc(Mid(str, i, 1))
If c < 0 Then c = c + 65536
If c > 255 Then t = t + 1
Next
strLength = t
Else
strLength = Len(str)
End If
End Function
''=================================================
''函数名:isInteger
''作 用:判断数字是否整型
''参 数:para ----参数
''=================================================
Public Function isInteger(ByVal para)
On Error Resume Next
Dim str
Dim l, i
If IsNull(para) Then
isInteger = False
Exit Function
End If
str = CStr(para)
If Trim(str) = "" Then
isInteger = False
Exit Function
End If
l = Len(str)
For i = 1 To l
If Mid(str, i, 1) > "9" Or Mid(str, i, 1) < "0" Then
isInteger = False
Exit Function
End If
Next
isInteger = True
If Err.Number <> 0 Then Err.Clear
End Function
Public Function CutString(ByVal str, ByVal strLen)
On Error Resume Next
Dim HtmlStr, l, re, strContent
HtmlStr = str
HtmlStr = Replace(HtmlStr, " ", " ")
HtmlStr = Replace(HtmlStr, """, Chr(34))
HtmlStr = Replace(HtmlStr, "'", Chr(39))
HtmlStr = Replace(HtmlStr, "{", Chr(123))
HtmlStr = Replace(HtmlStr, "}", Chr(125))
HtmlStr = Replace(HtmlStr, "$", Chr(36))
HtmlStr = Replace(HtmlStr, vbCrLf, "")
HtmlStr = Replace(HtmlStr, "====", "")
HtmlStr = Replace(Htm