怎么创建一个文件夹这样的( c:\1\2\3.....\100 ) 谁能给我个代码看看

解决方案 »

  1.   

    可以使用MkDir函数逐层目录的创建,即:先创建文件夹:1  再创建文件夹 2大致如下:
    Private Sub Command1_Click()
        Dim strP As String
        Dim intP As Integer
        intP = 1
        strP = "D:\1"
        Do
            MkDir strP
            intP = intP + 1
            strP = strP & "\" & CStr(intP)
        Loop Until intP > 10
    End Sub只是不知道Windows系统的文件夹系统允许多少层,可能不会有一百层吧
      

  2.   

    Option Explicit
    Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal DirPath As String) As LongPrivate Sub Command1_Click()
       MakeSureDirectoryPathExists "c:\0\1\2\3\4\5\6\7\8\9"
       MsgBox "建立完成!"
    End Sub