Solved

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

Posted on 2009-04-13
4
191 Views
Last Modified: 2013-11-25
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

0
Comment
Question by:jhmblvd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24130901
You can add a label bellow the player and show that!
0
 

Author Comment

by:jhmblvd
ID: 24131075
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.
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 24131094
And this way it's ok for you ?
Me.txtArtist.Text = IO.Path.GetFileNameWithoutExtension(dlgOpen.FileName.Trim)

Open in new window

0
 

Author Closing Comment

by:jhmblvd
ID: 31569568
Thanks ipaulino! Works great
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question