home *** CD-ROM | disk | FTP | other *** search
- 'Option 1 ****************
-
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
- My.Computer.FileSystem.CurrentDirectory = "C:\windows\media"
- ListBox1.DataSource = My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchTopLevelOnly, "*.wav")
- End Sub
-
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If ListBox1.SelectedItem <> "" Then
- Me.AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem.ToString
- Else
- MsgBox("Please select a file", MsgBoxStyle.OkOnly, "Select a file")
- End If
- End Sub
-
-
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- End
- End Sub
-
-
- 'Option 2**********
-
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
- My.Computer.FileSystem.CurrentDirectory = "C:\windows\media"
- For Each File As String In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchTopLevelOnly, "*.wav")
- ListBox1.Items.Add(My.Computer.FileSystem.GetFileInfo(File).Name)
- Next
- End Sub
-
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If ListBox1.SelectedItem <> "" Then
- Me.AxWindowsMediaPlayer1.URL = My.Computer.FileSystem.CurrentDirectory + "\" + ListBox1.SelectedItem.ToString
- Else
- MsgBox("Please select a file", MsgBoxStyle.OkOnly, "Select a file")
- End If
- End Sub
-
-
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- End
- End Sub
- End Class
-