[vb.net] GetFile / GetPath > vb.net

본문 바로가기

vb.net

[기타] [vb.net] GetFile / GetPath

회원사진
하나를하더라도최선을
2019-10-09 01:33 8,192 0

본문



    Private Function GetFile() As String
        Dim OFD As OpenFileDialog = New OpenFileDialog
        OFD.Filter = "Files|*.*"
        OFD.FileName = "Select a File"
        Dim result As DialogResult = OFD.ShowDialog()
        If result = Windows.Forms.DialogResult.OK Then
            Return System.IO.Path.GetFullPath(OFD.FileName)
        End If
        Return Nothing
    End Function
 
    Private Function GetPath() As String
        Dim FD As FolderBrowserDialog = New FolderBrowserDialog
        Dim result As DialogResult = FD.ShowDialog()
        If result = DialogResult.OK Then
            Return FD.SelectedPath & ""
        End If
        Return Nothing
    End Function
 

댓글목록0

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