Visual Studio 2010 使用Windows Media Player控件实现播放音乐视频

来源:互联网 发布:seo前景 编辑:程序博客网 时间:2024/06/08 16:28

1.新建Windows窗体应用程序

2.左侧工具栏-任意空白处,点击右键-选择项-找到com组件中的“Windows Media Player控件”,选中,点击确定


3.这时,该控件已经出现在工具栏,然后将控件拖拽到WinForm中即可。

4.将需要播放的MP3或者其他视频,拷贝到项目的debug目录下;

5.设置Windows Media Player控件的URL属性,或者通过编码实现 this.wmpMusic.URL = "ppn.3gp"; 均可。

6.运行测试。。。