您的位置:首页 > 编程语言 > C#

C# MP3文件属性读取

2014-03-26 17:13 405 查看
using (TempFile tempFile = new TempFile())
{
using (FileStream fs = new FileStream(tempFile.FileName, FileMode.Create, FileAccess.Write, FileShare.Read, 0x1000))
using (Stream input = propertyBag.GetResponse())
{
input.CopyToStream(fs);
}

UltraID3 id3 = new UltraID3();
id3.Read(tempFile.FileName);

propertyBag["MP3_Album"].Value = id3.Album;
propertyBag["MP3_Artist"].Value = id3.Artist;
propertyBag["MP3_Comments"].Value = id3.Comments;
propertyBag["MP3_Duration"].Value = id3.Duration;
propertyBag["MP3_Genre"].Value = id3.Genre;
propertyBag["MP3_Title"].Value = id3.Title;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: