sLoc是输入的路径, If Dir(sLoc, vbDirectory) = "" Then MkDir (sLoc) End If 如果我输入ttt,他会在C:\Program Files\Microsoft Visual Studio\VB98下面声成ttt目录
if len(dir("c:\ttt"))>0 then 存在 else 不存在 end if
if len(dir("c:\ttt"))>0 then 存在 else 不存在 end if
'调用方法:MsgBox IsPath("C:\Windows") Public Function IsPath(ByVal Path As String) As Boolean On Error GoTo 1 IsPath = False MkDir Path RmDir Path Exit Function 1: IsPath = True End Function
存在
else
不存在
end if
If Dir(sLoc, vbDirectory) = "" Then
MkDir (sLoc)
End If
如果我输入ttt,他会在C:\Program Files\Microsoft Visual Studio\VB98下面声成ttt目录
存在
else
不存在
end if
存在
else
不存在
end if
Public Function IsPath(ByVal Path As String) As Boolean
On Error GoTo 1
IsPath = False
MkDir Path
RmDir Path
Exit Function
1:
IsPath = True
End Function
存在
else
不存在
end if