[vb6.0/vba] 선택한 폴더의 속성정보 가져오기 / get folder properties > vb6.0/vba

본문 바로가기

vb6.0/vba

[vb6.0/vba] [vb6.0/vba] 선택한 폴더의 속성정보 가져오기 / get folder properties

회원사진
하나를하더라도최선을
2020-02-03 12:21 3,748 0

본문



Sub program1472_com()
    Dim fso As Object, f As Object
    Dim fPath As String
    Set fso = CreateObject("Scripting.FileSystemObject")
    With Application.FileDialog(msoFileDialogFolderPicker)
        .Title = "Select a Folder"
        .AllowMultiSelect = False
        .InitialFileName = Application.DefaultFilePath
        If .Show <> -1 Then Exit Sub
        fPath = .SelectedItems(1)
    End With
    
    Set f = fso.GetFolder(fPath)
    On Error GoTo ErrPass
    Debug.Print "만 든 날 짜 : " & f.DateCreated
    Debug.Print "위       치 : " & f.Drive
    Debug.Print "이       름 : " & f.Name
    Debug.Print "상 위 폴 더 : " & f.ParentFolder
    Debug.Print "경       로 : " & f.Path
    Debug.Print "짧 은 경 로 : " & f.ShortPath
    Debug.Print "할 당 크 기 : " & f.Size
    Debug.Print "종       류 : " & f.Type
    Debug.Print "파       일 : " & f.Files.Count
    Debug.Print "폴       더 : " & f.SubFolders.Count
ErrPass:
    If Err Then
        Err.Clear
        MsgBox "폴더만 가능합니다."
    End If
End Sub
 

댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색