Googler

两情相悦,又岂在朝朝暮暮。

C# MP3文件属性读取

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;
            }

 

posted on 2014-03-26 17:13  RockyLOMO  阅读(1160)  评论(0编辑  收藏  举报

导航

Apple/苹果笔记本 Mac Air MC968CH/A 行货在保 I5 11寸 超级本