2
Exit Function
Case Else
CheckUrl = 0
End Select
End Function
''================================================
''函数名:ReadFileName
''作 用:读取HTML文件名
''参 数:strname ----文件名称
'' id ----数据ID
'' ExtName ----HTML扩展名
'' PrefixStr ----HTML名称前缀
'' HtmlForm ----HTML文件格式
'' n ----HTML分页
''================================================
Public Function ReadFileName(ByVal strname, ByVal id, ByVal ExtName, ByVal PrefixStr, ByVal HtmlForm, ByVal n)
Dim strFileName, strExtName, CurrentPage
If Trim(strname) = "" Then Exit Function
If Trim(ExtName) = "" Then ExtName = ".html"
If Not IsNumeric(n) Then n = 0
On Error Resume Next
If CInt(n) <= 1 Then
CurrentPage = ""
Else
CurrentPage = "_" & n
End If
If Left(ExtName, 1) <> "." Then
strExtName = "." & Trim(ExtName)
Else
strExtName = Trim(ExtName)
End If
Select Case Trim(HtmlForm)
Case "1"
strFileName = Trim(id)
Case "2"
strFileName = Trim(PrefixStr) & Trim(Supplemental(id, 3))
Case "3"
strFileName = Left(strname, 8)
strFileName = strFileName & Trim(Supplemental(id, 3))
Case "4"
strFileName = Right(strname, 7)
strFileName = strFileName & Trim(Supplemental(id, 3))
Case Else
strFileName = strname
End Select
strFileName = Replace(strFileName & CurrentPage & strExtName, " ", "")
ReadFileName = CStr(strFileName)
End Function
''================================================
''过程名:HtmlRndFileName
''作 用:取HTML的随机文件名
''================================================
Function HtmlRndFileName()
Dim sRnd
Randomize
sRnd = Int(90 * Rnd) + 10
HtmlRndFileName = Replace(Replace(Replace(FormatDate(Now(), 1), "-", ""), ":", ""), " ", "") & sRnd
End Function
''================================================
''函数名:ClassFileName
''作 用:读取HTML文件列表名
''参 数:ClassID ----分类ID
''================================================
Public Function ClassFileName(ByVal ClassID, ByVal ExtName, ByVal PrefixStr, ByVal n)
Dim strFileName, strExtName, strClassID
If Trim(ExtName) = "" Then ExtName = ".html"
If Not IsNumeric(n) Then n = 0
If Left(ExtName, 1) <> "." Then
strExtName = "." & Trim(ExtName)
Else
strExtName = Trim(ExtName)
End If
If CInt(n) <= 1 Then
strFileName = "index" & strExtName
Else
strClassID = Supplemental(ClassID, 3)
strFileName = PrefixStr & strClassID & "_" & n & strExtName
End If