麻烦群主帮我改一下代码!!我真的不知道这,,单击事件怎么改
Private Type 数据结构类型
名字 As String
URL As String
End Type
Dim dat() As 数据结构类型
Private Sub Form_Load()
Dim file As String
Dim fj() As String
Dim i As String
Dim fr As Long
Dim k As Boolean
Dim j As Long
fr = FreeFile
file = "1.ini"
Open file For Input As fr
Do While Not EOF(fr)
Line Input #fr, i
If i = "[网络广播电台]" Then
'只有读到头,才算结束
k = True
End If
If UCase(i) = "END" Then
'读到 end ,算文件结束
Exit Do
End If
If k Then
'只有读到头后,才开始分析网址
If InStr(1, i, "=") > 0 Then
j = j + 1
'首次要计数
End If
End If
Loop
Close #fr
ReDim dat(j)
j = 0
Open file For Input As fr
Do While Not EOF(fr)
Line Input #fr, i
If i = "[网络广播电台]" Then
'只有读到头,才算结束
k = True
End If
If UCase(i) = "END" Then
'读到 end ,算文件结束
Exit Do
End If
If k Then
'只有读到头后,才开始分析网址
If InStr(1, i, "=") > 0 Then
fj = Split(i, "=")
dat(j).名字 = fj(0)
dat(j).URL = fj(1)
List1.AddItem dat(j).名字
j = j + 1
'首次要计数
End If
End If
Loop
Close #fr
Me.Caption = "网络收音机"
List1.ToolTipText = "双击换台"
End Sub
Private Sub List1_DblClick()
WindowsMediaPlayer1.URL = dat(List1.ListIndex).URL
Me.Caption = "网络收音机--" & dat(List1.ListIndex).名字
End Sub