CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 18

Threaded View

  1. #1
    Join Date
    Mar 2011
    Posts
    153

    [RESOLVED] problem with music playlist

    Here is the relevant code.

    Code:
        Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLAdd.Click
            OpenFileDialog2.ShowDialog()
            Playlist.Items.Add(OpenFileDialog2.FileName)
        End Sub
    
        Private Sub Remove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLRemove.Click
            Playlist.Items.Remove(Playlist.SelectedItem)
        End Sub
    
        Private Sub PLSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLSave.Click
            IO.Directory.CreateDirectory("C:\Selector\Playlists")
            Dim w As New IO.StreamWriter("C:\Selector\Playlists\test.txt")
            Dim i As Integer
            For i = 0 To Playlist.Items.Count - 1
                w.WriteLine(Playlist.Items.Item(i))
            Next
            w.Close()
        End Sub
    
        Private Sub PLLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLLoad.Click
            Dim r As New IO.StreamReader("C:\Selector\Playlists\test.txt")
            While (r.Peek() > -1)
                Playlist.Items.Add(r.ReadLine)
            End While
            r.Close()
        End Sub
    
        Private Sub PLPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PLPlay.Click
            Process.Start(Playlist.SelectedItem)
        End Sub
    I want to allow the user to name their own file for the playlist instead of it being "test.txt".

    I want a way to avoid duplicate song files.

    I want a way to shorten the file name to exclude the file path. (I'll probably have that figured out on my own)

    I want to overwrite one playlist with a loaded one.

    Finally, How can I make this symbol, ►, in vb.net? (for my play button)
    Last edited by 957; March 22nd, 2011 at 06:50 AM. Reason: grammar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured