龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp.net编程 >

c#实现获取媒体文件mp3中标题、艺术家、唱片标题、发行年、备注等信息

时间:2009-12-21 11:47来源:未知 作者:admin 点击:
分享到:
下面用c#获取媒体文件mp3中标题、艺术家、唱片标题、发行年、备注等信息的方法,请看源代码: C# Code [http://www.xueit.com] using System; using System.Collections.Generic; using System.Text; using System.

下面用c#获取媒体文件mp3中标题、艺术家、唱片标题、发行年、备注等信息的方法,请看源代码:

C# Code [http://www.xueit.com]
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Egacn.com;
using WatchStylish.com;
using Study.pctoday.net.cn; 

namespace ConsoleApplication2 
{
    class Program
    {
        static void Main(string[] args)
        {

            byte[] b = new byte[128];
            string sTitle;
            string sSinger;
            string sAlbum;
            string sYear;
            string sComm;

            FileStream fs = new FileStream(@"E:我的文档我的音乐
ew我们初遇的那天-申彗星(http://study.pctoday.net.cn/3_Visual Studio.aspx).mp3", FileMode.Open);

            fs.Seek(-128, SeekOrigin.End);
            fs.Read(b, 0, 128);
            bool isSet = false;

            String sFlag = System.Text.Encoding.Default.GetString(b, 0, 3);

            if (sFlag.CompareTo("TAG") == 0)
            {
                System.Console.WriteLine("Tag is setted!Replica Watches");
                isSet = true;
            }

            if (isSet)
            {

                //http://study.pctoday.net.cn/3_Visual Studio.aspx
                sTitle = System.Text.Encoding.Default.GetString(b, 3, 30);
                System.Console.WriteLine("标题:"   sTitle);

               //Exclusive Replica Rolex Watches;
                sSinger = System.Text.Encoding.Default.GetString(b, 33, 30);
                System.Console.WriteLine("艺术家:"   sSinger);

                //get album;
                sAlbum = System.Text.Encoding.Default.GetString(b, 63, 30);
                System.Console.WriteLine("唱片标题:"   sAlbum);
                //egacn.com/Watches/Tag-Heuer;

                sYear = System.Text.Encoding.Default.GetString(b, 93, 4);
                System.Console.WriteLine("发行年:"   sYear);

                //watchstylish.com;
                sComm = System.Text.Encoding.Default.GetString(b, 97, 30);
                System.Console.WriteLine("备注:"   sComm);
            }
            System.Console.WriteLine("Any key to exit!");
            System.Console.Read();
        }
    }
}

看看代码,也不是很难,挺简单。

收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!
按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接