newasp中main类

2019-01-14 07:48:24王振洲

                sTempPath = sTempPath & "" & sPathItem(i)
                If fso.FolderExists(sTempPath) = False Then
                    fso.CreateFolder sTempPath
                End If
            End If
        Next
        Set fso = Nothing
        If Err.Number <> 0 Then Err.Clear
        CreatPathEx = True
    End Function
    '================================================
    '函数名:FilesDelete
    '作  用:FSO删除文件
    '参  数:filepath   ----文件路径
    '返回值:False  ----  True
    '================================================
    Public Function FileDelete(ByVal FilePath)
        On Error Resume Next
        FileDelete = False
        Dim fso
        Set fso = Server.CreateObject(FSO_ScriptName)
        If FilePath = "" Then Exit Function
        If InStr(FilePath, ":") = 0 Then FilePath = Server.MapPath(FilePath)
        If fso.FileExists(FilePath) Then
            fso.DeleteFile FilePath, True
            FileDelete = True
        End If
        Set fso = Nothing
        If Err.Number <> 0 Then Err.Clear
    End Function
    '================================================
    '函数名:FolderDelete
    '作  用:FSO删除目录
    '参  数:folderpath   ----目录路径