示例#1
0
 public static Mp3Tag GetFileTags(string filePath)
 {
     using (var mp3 = new Mp3(filePath, Mp3Permissions.Read))
     {
         Id3Tag tag;
         if (mp3.HasTagOfFamily(Id3TagFamily.Version1X))
         {
             tag = mp3.GetTag(Id3TagFamily.Version1X);
         }
         else
         {
             tag = mp3.GetTag(Id3TagFamily.Version2X);
         }
         if (tag != null)
         {
             return(new Mp3Tag(tag));
         }
         return(null);
     }
 }