im trying to make mp3 player using listbox named "playlist" contains items opened by openfiledialouge named "ofd" and windowsmediaplayer named wmp.
the problem is that playlist items must have the full path to run using the code
For Each track As String In ofd.FileNames
the line
make a good result as i want but the wmp doesn't work with it
here is my img
the problem is that playlist items must have the full path to run using the code
For Each track As String In ofd.FileNames
VB.NET:
Private Sub ofd_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ofd.FileOk
If Button6.Text = "Open" Then
For Each track As String In ofd.FileNames
playlist.Items.Add(track)
Next
playlist.SelectedIndex = 0
wmp.URL = playlist.SelectedItem
Button2.Enabled = True
btnn.Enabled = True
btnb.Enabled = True
Button3.Enabled = True
Button3.Text = "Pause"
Button6.Text = "Add"
ElseIf Button6.Text = "Add" Then
For Each track As String In ofd.FileNames
playlist.Items.Add(track)
Next
End If
the line
VB.NET:
For Each track As String In ofd.SafeFileNames
make a good result as i want but the wmp doesn't work with it
here is my img
Last edited: