浏览文件夹路径--获取路径

来源:互联网 发布:nginx配置php域名访问 编辑:程序博客网 时间:2024/05/16 12:20
 Private Sub Browse_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Browse.Click
            Dim FBDlg As FolderBrowserDialog = New FolderBrowserDialog()
            FBDlg.Description = "Browse for Folder"
            FBDlg.ShowNewFolderButton = False
            If TarPath.Text <> "" Then
                FBDlg.SelectedPath = TarPath.Text
            Else
                FBDlg.RootFolder = Environment.SpecialFolder.MyComputer
            End If
            Dim ResultPath As DialogResult = FBDlg.ShowDialog()
            If ResultPath = DialogResult.OK Then
                Dim folderPath As String = FBDlg.SelectedPath
                If folderPath <> "" Then
                    TarPath.Text = folderPath
                End If
            End If
        End Sub
0 0