Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-13
4
Medium Priority
?
210 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses

610 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