Dev/Visual Basic

폴더 만들기 ( 부모 폴더가 없을경우에는 부모 폴더도 만듬)

newtype 2003. 7. 18. 17:34
' 경로를 만든다.
Public Function MakeDir(ByVal strpath As String) As Boolean

   If strpath = "" Then Exit Function
   
   strpath = Replace(strpath, "/", "\")

   If Right(strpath, 1) = "\" Then strpath = Mid(strpath, 0, Len(strpath) - 1)
   
   If Dir(strpath, vbDirectory) <> "" Then
   
       MakeDir = True
       Exit Function
   
   End If
   
   MakeDir = MakeDir(ExtractDir(strpath))
   
   MkDir (strpath)

End Function
반응형