有点意思。看代码吧!
'播放音乐 Sub Play(url) Set oWMP = CreateObject("WMPlayer.OCX") oWMP.URL = url Do while oWMP.playState = 9 Or oWMP.playState = 3 WScript.Sleep(1000) Loop End Sub Play("汤潮-那滋味.mp3") |
还可以控制光驱
'弹出所有光驱 Sub EjectAllCDROM() Set oWMP = CreateObject("WMPlayer.OCX") Set colCDROMs = oWMP.cdromCollection If colCDROMs.Count >= 1 then For i = 0 to colCDROMs.Count - 1 colCDROMs.Item(i).Eject Next End If End Sub EjectAllCDROM |
受教了!呵呵!