Map in een playlist uitpakken

Status
Niet open voor verdere reacties.

bonnowagt

Gebruiker
Lid geworden
7 dec 2006
Berichten
445
Hallo,

Via het drag en drop systeem schuif ik bijvoorbeeld mp3 files van de verkenner naar de playlist van een musicplayer. (VB 2010).

Ook kan ik natuurlijk een complete lijst met bijvoorbeeld 100 mp3 op de playlist schuiven, maar die map moet dan vervolgens worden uitgepakt, zodat de mps3 in de lijst komen en niet de map.


Groet
 
Voorbeeld over hoe een directory te filteren op mp3's:

[cpp]Dim Map As String = "Pad"
For Each item As String In System.IO.Directory.GetFiles(Map)
If item.EndsWith(".mp3") Then Console.WriteLine(item)
Next[/cpp]
 
Ik heb nu als dropcode:
Code:
Private Sub ListBox1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
Dim files As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
or Each filename As String In files
ListBox1.Items.Add(System.IO.Path.GetFullPath(filename))
Next
End Sub

Dus de files komen hierdoor in listbox1(playlsit)

Hoe zou jouw oplossing er tussen moeten dan?
en wat is het pad, welk p[as zou dit dan moeten zijn
 
Voìla:

[cpp]Private Sub ListBox1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
Dim files As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
For Each filename As String In files
Dim path As String = System.IO.Path.GetFullPath(filename)
If System.IO.Directory.Exists(path) Then
For Each item As String In System.IO.Directory.GetFiles(path)
If Not ListBox1.Items.Contains(item) Then If item.EndsWith(".mp3") Then ListBox1.Items.Add(item)
Next
Else
If Not ListBox1.Items.Contains(path) Then ListBox1.Items.Add(path)
End If
Next
End Sub

Private Sub txtDrop_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
e.Effect = DragDropEffects.Copy
End Sub[/cpp]
 
Perfect het werkt grandioos. Erg bedankt. Heb het niet zon beetje af maar heb nu nog een vraagje.
Als ik het programma run werkt het prima, Ik heb er een publish van gemaakt. Bij de opsporing van de fout krijg ik de mededeling dat hij de de AXinterop.lib.dll nie tkan vinden. Deze staat toch gewoon in zijn pad.
 
Ik krijg de volgende foutmelding

COM Reference 'WMPLib' is the interop assembly for ActiveX control 'AxWMPLib' but was marked to be linked by the compiler with the /link flag. This COM reference will be treated as a reference and will not be linked.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan