Agrega los siguientes objetos:
- TextBox1
- Button1
- ListBox1
- AxWindowsMediaPlayer1
Y agrega el siguiente código:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim FolderBrowserDialog1 As New FolderBrowserDialog
FolderBrowserDialog1.Description = "Seleccione el Directorio"
Dim dirSelected As DialogResult = FolderBrowserDialog1.ShowDialog(Me)
If dirSelected = DialogResult.OK Then
TextBox1.Text = FolderBrowserDialog1.SelectedPath
End If
ListBox1.Items.Clear()
Try
Dim folders() As FileInfo
= New DirectoryInfo
(TextBox1.
Text).
GetFiles ListBox1.
Items.
Add(folder.
Name) Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
AxWindowsMediaPlayer1.URL = TextBox1.Text & "\" & ListBox1.SelectedItem.ToString
End Sub
Recordad agregar la librería,
Imports System.IO
Resultado,