Link to home
Start Free TrialLog in
Avatar of jhmblvd
jhmblvdFlag for United States of America

asked on

How do you read the artist info and other data from a music file?

I am trying to create a playlist using windows media player component. I have code that will open up a song and play it, I now want to see what is playing. What is the best way to do this?
//This code loads a song. I want to display the songs title and artist info in a text box. 
 
  Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
        dlgOpen.InitialDirectory = My.Computer.FileSystem.CurrentDirectory
        dlgOpen.ShowDialog()
        Player.URL = dlgOpen.FileName
 
   End Sub

Open in new window

Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

You can add a label bellow the player and show that!
Avatar of jhmblvd

ASKER

I tried this:

  Me.txtArtist.Text = dlgOpen.FileName.Trim

But it gives me the whole path to the file including the name of the song.
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhmblvd

ASKER

Thanks ipaulino! Works great