用于获取MP3内部信息,包括歌曲名,歌手名等…… namespace FileBatchRemaer.domain { /// <summary> /// Mp3信息结构 /// </summary> public struct Mp3Info { public string identify; //TAG,三个字节 public string Title; //歌曲名,30个字节 public string Artist; //歌手名,30个字节 public string Album; //所属唱片,30个字节 public string Year; //年,4个字符 public string Comment; //注释,28个字节 public char reserved1; //保留位,一个字节 public char reserved2; //保留位,一个字节 public char reserved3; //保留位,一个字节 } /// <summary> /// Mp3文件信息类 /// </summary> public class Mp3FileInfo { Mp3Info info; /// <summary> /// 构造函数,输入文件名即得到信息 /// </summary> /// <param name="mp3FilePos"></param> public Mp3FileInfo(String mp3FilePos) { info = getMp3Info(getLast128(mp3FilePos)); } /// <summary> /// 获取整理后的Mp3文件名,这里以标题和艺术家名定文件名 /// </summary> /// <returns></returns> public String GetOriginalName() { return formatString(info.Title.Trim()) + "-" + formatString(info.Artist.Trim()); } /// <summary> /// 去除 字符 /// </summary> /// <param name="str"></param> /// <returns></returns> private String formatString(String str) { return str.Replace("