• ASP创建多级无限文件夹


    Function CreateMultiFolder(ByVal CFolder) '使用方法call CreateMultiFolder(flodern)
    Dim objFSO, PhCreateFolder, CreateFolderArray, CreateFolder
    Dim i, ii, CreateFolderSub, PhCreateFolderSub, BlInfo
    BlInfo = False
    CreateFolder = CFolder
    On Error Resume Next
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    If Err Then
    Err.Clear()
    Exit Function
    End If
    CreateFolder = Replace(CreateFolder, "", "/")
    If Left(CreateFolder, 1) = "/" Then
    CreateFolder = Right(CreateFolder, Len(CreateFolder) -1)
    End If
    If Right(CreateFolder, 1) = "/" Then
    CreateFolder = Left(CreateFolder, Len(CreateFolder) -1)
    End If
    CreateFolderArray = Split(CreateFolder, "/")
    For i = 0 To UBound(CreateFolderArray)
    CreateFolderSub = ""
    For ii = 0 To i
    CreateFolderSub = CreateFolderSub & CreateFolderArray(ii) & "/"
    Next
    PhCreateFolderSub = Server.MapPath(CreateFolderSub)
    If Not objFSO.FolderExists(PhCreateFolderSub) Then
    objFSO.CreateFolder(PhCreateFolderSub)
    End If
    Next
    If Err Then
    Err.Clear()
    Else
    BlInfo = True
    End If
    CreateMultiFolder = BlInfo
    End Function

  • 相关阅读:
    codeforces 616B Dinner with Emma
    codeforces 616A Comparing Two Long Integers
    codeforces 615C Running Track
    codeforces 612C Replace To Make Regular Bracket Sequence
    codeforces 612B HDD is Outdated Technology
    重写父类中的成员属性
    子类继承父类
    访问修饰符
    方法的参数
    实例化类
  • 原文地址:https://www.cnblogs.com/keringing/p/5368591.html
Copyright © 2020-2023  润新知