VB怎么用WMP制作MP3播放器

VB怎么用WMP制作MP3播放器,要能读取列表到List1的,并能自动播放下首歌曲,还能保存列表到指定文件,并下次启动时,load事件读取到列表?源代码给我,我的QQ:9... VB怎么用WMP制作MP3播放器,要能读取列表到List1的,并能自动播放下首歌曲,还能保存列表到指定文件,并下次启动时,load事件读取到列表?源代码给我,我的QQ:908187145,我的Email:laoluohacker@vip.qq.com
算了,源代码给我一份,然后在这也公布代码,让大家学习学习
展开
 我来答
沙慧月03
2010-08-15 · TA获得超过2157个赞
知道大有可为答主
回答量:2717
采纳率:100%
帮助的人:3617万
展开全部
源代码已发
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias _
"SHGetPathFromIDListA" (ByVal pIdl As Long, ByVal pszPath As String) As Long

Private Type BrowseInfo
hwndOwner As Long
piDLroot As Long
pszdisplayName As String
lpsztitle As String
ulFlags As Long
lpfncallback As Long
lParam As Long
iImage As Long
End Type
Private Sub Command1_Click()
Dim bi As BrowseInfo
Dim folderid As Long
Dim pb As String
With bi
.hwndOwner = Me.hWnd
.lpsztitle = "把输出的文件存放到这个文件夹:"
.ulFlags = 3
End With
folderid = SHBrowseForFolder(bi)
If folderid = 0 Then Exit Sub
pb = String$(260, 0)
SHGetPathFromIDList folderid, pb
pb = Left$(pb, InStr(pb, vbNullChar) - 1)
File1.Path = pb
End Sub

Private Sub Command2_Click()

End Sub

Private Sub Command3_Click()
Timer1.Interval = 0
WindowsMediaPlayer1.Controls.stop
End Sub

Private Sub File1_Click()
If File1.ListCount > 0 Then
If Right(pb, 1) <> "\" Then
Label1.Caption = File1.Path & "\" & File1.FileName
WindowsMediaPlayer1.URL = Label1.Caption
End If

Else
Label1.Caption = pb & file.FileName
Label3.Caption = WindowsMediaPlayer1.currentMedia.durationString
End If

End Sub

Private Sub Form_Load()
If Dir(App.Path & "list.txt") = "" Then
Else
Open App.Path & "list.txt" For Input As #1
Line Input #1, a
File1.Path = a
End If
Close (1)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "list.txt" For Output As #1
Print #1, File1.Path
Close (1)
End Sub

Private Sub Timer1_Timer()
Label2.Caption = "列表中共有" & File1.ListCount & "个"
If WindowsMediaPlayer1.playState = 1 Then
WindowsMediaPlayer1.URL = File1.List(File1.ListIndex + 1)

If File1.ListCount > File1.ListIndex + 1 Then
File1.ListIndex = File1.ListIndex + 1
End If
End If
WindowsMediaPlayer1.Controls.play
Label4.Caption = WindowsMediaPlayer1.Controls.currentPositionString

End Sub
落雪待玉人
2010-08-14 · TA获得超过170个赞
知道小有建树答主
回答量:286
采纳率:0%
帮助的人:165万
展开全部
有就放出来大家学习嘛,干嘛老发什么邮箱嘛。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式