vb.nettagsmp3id3-tag

Reading mp3 tag information in vb.net


I'm doing a project in VB.NET 2005, in which I have to extract the tag information of mp3 files. For that purpose I have used code in this page. But the issue is when one of the tag is empty, it didn't return any values.

For example, using this i can retrieve album information like this,

    Dim album As String = ""
    album = objMP3V1.Frame(MP3ID3v1.FrameTypes.Album)

But I didn't know how to check the album variable is empty or not, I checked album variable

    If (album = "") Then
        MsgBox("true")
    ElseIf (album Is Nothing) Then
        MsgBox("true")
    ElseIf (album Is DBNull.Value) Then
        MsgBox("true")
    End If

but no success, can somebody help me.


Solution

  • I've used regular expression to solve this issue. Thanks for all your help...

    Imports System.Text.RegularExpressions
    dim RegEx As New RegularExpressions.Regex("^[a-zA-Z0-9]+$")
    dim Match As Match
    dim film as string
    film = song.Frame(MP3ID3v1.FrameTypes.Album)
    Match = RegEx.Match(film)
    film1 = IIf((Match.Success), film.ToString, "")  
    

    If you looking for more professional tag editior Here's a link!