Hello,
I am trying to access my website and display the .mp3 files in a certain directory.

Through this, i want to have windows media player play the selected file.

Either through list box, or combo box.

I have tried many different ways. Please help.

How in the world am i supposed to do this?

I do not just want to set the windows media player url to a certain file, like i said, i am trying to get to select the file (in some sort of dialog box) and play that.

Try this:

First, add a webservice your website with a method to read directory content and also a method to read a selected file into a byte array.

Second, use that webservice in your window app in order to 1) display directorycontent in a listbox/combobox and 2) retrieve the byte array and convert it into a memorystream.

You can then create a HTTP server and inform WMP to stream from http://localhost:port/<something>. Then push your stream to WMP.

Okay, i found this simple example of reading a folder...

Dim directory As Directory
        Dim files As String()
        Dim file As String

        directory.GetFiles("http://xxx.com/music/", "*.mp3")
        For Each file In files
            Dim link As New LinkLabel()
            Do
                link.Text = file
                Me.Controls.Add(link)
            Loop
        Next

Not sure if this will work, but i will try anything.


Unfortunately URL format is not supported.

I have this:

[IMG]http://img121.imageshack.us/img121/2764/radiopo.jpg[/IMG]

I am looking to click the sample.mp3 and play it with the windows media player that is in the form. Any ideas?

The site is a little messy right now, but our group is still in development.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.