C#WindowsMediaPlayer的播放列表

时间:2025-01-24 10:48:57

播放单首歌曲



= "歌曲文件路径";
();

添加多首歌曲到播放列表

 
 

IWMPPlaylist playList = ("MyPlayList"); //新建列表
            IWMPMedia media;

            foreach (DataRow drItem in )
            {
                media = (drItem["路径"].ToString()); //参数为歌曲路径
                (media);
            }

            = playList;
            ();    //开始播放

直接在当前列表上添加



();

            IWMPMedia media;

            foreach (DataRow drItem in )
            {
                media = (drItem["路径"].ToString()); //参数为歌曲路径
                (media);
            }