M3U文件格式

1、M3U文件只有在ANSI格式下方可正常播放。

2、但在C#中字符串默认格式均为UTF-8格式

3、格式转换实例

        FileStream fs = new FileStream(PlayPath, FileMode.OpenOrCreate, FileAccess.Write);

        StreamWriter sw = new StreamWriter(fs,Encoding.Default); //使用默认ANSI格式

        //StreamWriter sw = new StreamWriter(fs); //使用默认UTF-8格式 

        try

        {

            sw.WriteLine("#EXTM3U");

            FilePath = SqlDB.GetFirstValue("select filepath from xldata where djbh='" + djbh + "'");

            sw.WriteLine(FilePath);

            sw.Flush();

        }

        finally

        {

            sw.Close();

            fs.Close();

        }

posted @ 2010-03-16 10:55  EasyPass  阅读(3691)  评论(0编辑  收藏  举报