Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now