[vb.net] GetFile / GetPath

하나를하더라도최선을 2019-10-09 01:33:56 50,146 0 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개

첫 번째 댓글을 작성해보세요!