How to obtain music properties from a file using Visual Basic

Robert Homes

Member
Joined
Nov 16, 2023
Messages
11
Programming Experience
5-10
I have this, but it doesn't work:

VB.NET:
Imports Windows.Storage.FileProperties
Imports System.IO

    Private Sub RetrieveFolderProperties(D$)
        Dim File = "x:\music\Alabama\16 Biggest Hits\Mountain Music.mp3"
        Dim MusicProperties = File.properties.GetMusicPropertiesAsync

        Dim n = -1
        n = dg.Rows.Add(1)
        dg.Rows(n).Cells(0).Value = st.JustPath(D$)
        dg.Rows(n).Cells(3).Value = MusicProperties.Album
        dg.Rows(n).Cells(4).Value = MusicProperties.Genre
        dg.Rows(n).Cells(5).Value = MusicProperties.Rating
    End Sub

What can I do to get this or something like this working?

Also, how do you extrat the album cover or other image if there's one in the file?
 
Last edited by a moderator:
Please don't post unformatted code snippets. They are harder to read and you could see that certain substrings were replaced without the code formatting. I have fixed it for you this time.
 
"It doesn't work" is never an adequate problem description. You always need to explain exactly what does happen and how that differs from your expectations. If there's a compilation error or run-time exception, you need to specify what it is and where it occurs.
 

Latest posts

Back
Top