这个问题其实很简单的.我给你大致的代码: 在新建form中加入commondialog,command,mediaplayer private command1_click() commondialog1.showopen mediaplayer1.filename=commondialog1.filename mediaplayer1.autoplay=true end sub
摘自Windows Media Player SDK我也看不太懂,你看看吧,不行我再帮你找 还有,Windows Media Player6.4已经支持CDAudio,Windows Media Player6.4在Win98se中内置 Player6.FileName This property specifies or retrieves the name of the clip to play.SyntaxMediaPlayer.FileNamePossible ValuesThis property is a read/write String with a default value of "" (the empty string).ResIf the value of the AutoStart property is true, file playback begins automatically whenever you set the FileName property. If you set both AutoStart and FileName at design time, the Windows Media Player control begins playing the file when it is loaded.Setting this property is a synchronous operation; control does not return to the application until after the file has completed the open process. The Open method performs the same operation asynchronously. To use compact disc audio with your CD-ROM drive as input to the Windows Media Player control, set this property to cdaudio: (with the trailing ":"). For more information, see Compact Disc Audio Playback. To use digital video disc (DVD) as input, set this property to dvd: (with the trailing ":"). For more information, see Viewing DVD in a Web Page.
MediaPlayer1.FileName="E:\Track03.cda"
不然用 MediaPlayer1.Device = "CDAudio"
MMControl1.Command = "open"然后点击播放就可以了
再说,Windows Mediaplayer根本没有DeviceType。
网上关于MediaPlayer控件的代码很多,给你一个完整的代码范例先:
http://www.ryerson.ca/~sgray/vbamp.htm
在新建form中加入commondialog,command,mediaplayer
private command1_click()
commondialog1.showopen
mediaplayer1.filename=commondialog1.filename
mediaplayer1.autoplay=true
end sub
mediaplayer1.filename="e:\track03.cda"
mediaplayer1.autoplay=true
相同呀!
好像不行。
我就是急需在里面加入CD支持。我不想混用MCI控件,因为会增大安装体积。
紧迫紧迫!!各位大哥赶紧帮忙,救救我这个菜鸟!!!!
你要使用windowsmidiaplayer 你会更惨,因为7.0的mdeiaplay才支持CD
用98的人不可能去装的。它占用资源太大。如果你的用户对象是Windows Me那用它吧
还有,Windows Media Player6.4已经支持CDAudio,Windows Media Player6.4在Win98se中内置
Player6.FileName
This property specifies or retrieves the name of the clip to play.SyntaxMediaPlayer.FileNamePossible ValuesThis property is a read/write String with a default value of "" (the empty string).ResIf the value of the AutoStart property is true, file playback begins automatically whenever you set the FileName property. If you set both AutoStart and FileName at design time, the Windows Media Player control begins playing the file when it is loaded.Setting this property is a synchronous operation; control does not return to the application until after the file has completed the open process. The Open method performs the same operation asynchronously. To use compact disc audio with your CD-ROM drive as input to the Windows Media Player control, set this property to cdaudio: (with the trailing ":"). For more information, see Compact Disc Audio Playback. To use digital video disc (DVD) as input, set this property to dvd: (with the trailing ":"). For more information, see Viewing DVD in a Web Page.