public static DataSong getID3ByDirectory(string pDirectory) { DataSong id3op = new DataSong(); TagLib.File tagFile = TagLib.File.Create(pDirectory); List<string> p = new List<string>(); id3op._SongDirectory = pDirectory; id3op._ID3Title = tagFile.Tag.Title; id3op._ID3Album = tagFile.Tag.Album; id3op._ID3Year = (tagFile.Tag.Year.ToString()); id3op._ID3Lyrics = tagFile.Tag.Lyrics; if (tagFile.Tag.Genres.Length > 0) { id3op._ID3Genre = tagFile.Tag.Genres[0]; } if (tagFile.Tag.Performers.Length > 0) { id3op._ID3Artist = tagFile.Tag.Performers[0]; } id3op._SongName = tagFile.Name.Substring(tagFile.Name.LastIndexOf('\\') + 1); id3op.fillEmpty(); return id3op; }