用vb做个播放器

 主要代码:

If Dir(MusicName) <> "" Then '如果盘上有这个音乐文件
  ST = UCase(Right(MusicName, 3))
  If ST = "MP3" Then '如果是 MP3
    mciSendString "open " & MusicName & " alias music", 0&, 0, 0
  ElseIf ST = "WAV" Then '如果是 WAV
    mciSendString "open " & MusicName & " type waveaudio alias music", 0&, 0, 0
  Else '如果是 MID
    mciSendString "open " & MusicName & " type sequencer alias music", 0&, 0, 0
  End If
  mciSendString "play music FROM 0", 0&, 0, 0
End If

再后面的就你们自己去想了哦?

你可能感兴趣的:(音乐,vb)