用VB做realplayer播放下文
發(fā)表時間:2024-02-20 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]Realplayer的列表播放,利用一個REALPLAYER的路徑來實現(xiàn)的,在標(biāo)準(zhǔn)EXE窗體上,放置一個REALAUDIO1,和commondialog1,加二個按鈕,LIST1命名為lstItems,一個按鈕命名為添加文件,一個按鈕為保存列表,在添加文件中加入下如代碼: Private Sub ...
Realplayer的列表播放,利用一個REALPLAYER的路徑來實現(xiàn)的,在標(biāo)準(zhǔn)EXE窗體上,放置一個REALAUDIO1,和commondialog1,加二個按鈕,LIST1命名為lstItems,一個按鈕命名為添加文件,一個按鈕為保存列表,在添加文件中加入下如代碼:
Private Sub Command1_Click()
Dim sTmp As String
Dim strfix As String
Dim i As Integer
Dim yy As String
CommonDialog1.ShowOpen
sTmp = CommonDialog1.FileName
If Len(sTmp) = 0 Then Exit Sub
For i = 1 To Len(sTmp)
strfix = Mid(sTmp, i, 1)
If strfix = "\" Then
strfix = "/"
End If
yy = yy & strfix
Next i
sTmp = "File://" & yy
lstItems.AddItem sTmp
end sub
Private Sub Command2_Click()
Dim s As Integer
CommonDialog1.DialogTitle = "輸入要保存的RM文件"
CommonDialog1.Filter = "RealPlayer播放列表(*.RM) *.RM"
CommonDialog1.ShowSave
If Len(CommonDialog1.FileName) = 0 Then
Exit Sub
End If
Open CommonDialog1.FileName For Output As #1
For s = 0 To Me.lstItems.ListCount - 1
Print #1, Me.lstItems.List(s)
Next s
realaudio.source=commondialog.filename
realaudio.doplay
End Sub
Private Sub Form_Load()
realaudio1.controls="imagewindow"
End Sub
如加上刪除或移動文件,增加一些,修改一點,并可實現(xiàn)呀!