Solved

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

Posted on 2009-04-13
4
184 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 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