WinForm视频图片加载播放

来源:互联网 发布:c 编程实例详解 编辑:程序博客网 时间:2024/06/05 04:55

private voidForm1_Load(object sender, EventArgse)

        {

            this.axWindowsMediaPlayer1.currentPlaylist.clear();

            DirectoryInfo file =new DirectoryInfo(VideoAddress);//遍历指定文件夹下的文件

            foreach(FileInfo newFileinfile.GetFiles())

            {

               this.axWindowsMediaPlayer1.currentPlaylist.appendItem(this.axWindowsMediaPlayer1.newMedia(newFile.FullName));//把文件夹的视频和图片文件添加进来

            }

           axWindowsMediaPlayer1.settings.setMode("loop",true);//循环播放

           axWindowsMediaPlayer1.Ctlcontrols.play();//开始播放

           System.Media.SystemSounds.Beep.Play();//声音播放

        }

0 0
原创粉丝点击