最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
自动创建多级目录,有则跳过 无则创建,
时间:2022-07-02 23:04:46 编辑:袖梨 来源:一聚教程网
Function AutoCreateFolder(strPath) ' As Boolean
On Error Resume Next
Dim astrPath, ulngPath, i, strTmpPath
Dim objFSO
If InStr(strPath, "") <=0 or InStr(strPath, ":") <= 0 Then
AutoCreateFolder = False
Exit Function
End If
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strPath) Then
AutoCreateFolder = True
Exit Function
End If
astrPath = Split(strPath, "")
ulngPath = UBound(astrPath)
strTmpPath = ""
For i = 0 To ulngPath
strTmpPath = strTmpPath & astrPath(i) & ""
If Not objFSO.FolderExists(strTmpPath) Then
' 创建
objFSO.CreateFolder(strTmpPath)
End If
Next
Set objFSO = Nothing
If Err = 0 Then
AutoCreateFolder = True
Else
AutoCreateFolder = False
End If
End Function
相关文章
- oppok11玩游戏怎么样介绍 03-22
- 字母站是什么平台 03-22
- 如何删除emmo日记中的心情日记 03-22
- 万王之王3D铁卫技能加点推荐(铁卫技能加点详解及优化方案,助你成为无敌的王者!) 03-22
- 探秘第五人格佣兵天赋加点技巧(打造最强佣兵,助你成为游戏巅峰) 03-22
- 2026有用的老年人脑力训练游戏有什么 有趣的脑力训练游戏合集推荐 03-22