Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim songname$, appdisk$
Private Sub Form_Load()
appdisk = Trim(App.Path)
If Right(appdisk, 1) <> "\" Then appdisk = appdisk & "\"
songname = appdisk & "xxs.wma"
mciSendString "play " & songname, vbNullString, 0, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
mciSendString "stop " & songname, vbNullString, 0, 0
End Sub
================================================
以上代码可播放音乐,却不能循环.
另
要播放网上的音乐应该怎么做?需要循环的
请写明代码,注意要的是代码....
參考答案:你用这个控件吧
AxMediaPlayer.AxMediaPlayer
把它的this.axMediaPlayer1.FileName="路径"(可以中文)
this.axMediaPlayer2.PlayCount=0;//设置为循环播放