Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从头开始制作媒体播放器的 WPF 应用程序。我添加了一个列表框,我可以在其中从一首歌曲切换到下一首歌曲。我想将此列表保存为 m3u 播放列表,并且我也希望能够读取 m3u 文件。我正在使用媒体元素。我该怎么做呢?
m3u 列表中的每一行代表一个 mp3 文件
var mru = yourFileList.OfType<YourFileListType>().Select(f => f.TheFileName); // .Net 4.0 File.WriteAllLines("YourM3uFile.m3u", mru); // .Net 3.5 File.WriteAllLines("YourM3uFile.m3u", mru.ToArray());
希望有帮助