最新下载
热门教程
- 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
相关文章
- 流放之路2锻造大师梅克图尔打法攻略 10-21
- 燕云十六声乐不思蜀任务攻略分享 10-21
- 燕云十六声荣归故里任务攻略分享 10-21
- 绝区零卢西娅驱动怎么搭配-卢西娅驱动及词条搭配推荐 10-21
- 燕云十六声绝世高手任务攻略分享 10-21
- 燕云十六声山月无影心法获取方法分享 10-21