我的文本格式是 
http://www.kanxun.com/1.mp3
真的爱你
http://www.kanxun.com/2.mp3
光辉岁月
http://www.kanxun.com/3.mp3
海阔天空
.............这种格式该怎么加到list里啊?
我用
Open App.Path & "\音乐.txt" For Input As #1
    Do Until EOF(1)
    Line Input #1, a
    List1.AddItem a
    Loop
    Close #1
该怎么改才能让他 只显示歌名 单击出现 URL属性哦

解决方案 »

  1.   

    Dim URL() As StringPrivate Sub Fill_List()
    Erase URL
    List1.Clear
    Open App.Path & "\音乐.txt" For Input As #1
        Do Until EOF(1)
            Line Input #1, a
            Redim Preserve URL(List1.ListCount)
            URL(List1.ListCount) = a
            Line Input #1, a
            List1.AddItem a
        Loop
    Close #1
    End SubPrivate Sub List1_Click()
    MsgBox URL(List1.ListIndex)
    End If
      

  2.   

    Dim urlArr() As String
    Private Sub List1_Click()
        Me.Caption = urlArr(List1.ListIndex)
    End SubPrivate Sub Form_Load()
    Dim i As Long, a As String
    i = 0
    Open App.Path & "\音乐.txt" For Input As #1
    Do Until EOF(1)
        Line Input #1, a
        If i Mod 2 = 0 Then
            ReDim Preserve urlArr(i)
            urlArr(i / 2) = a
        Else
            List1.AddItem a
        End If
        i = i + 1
    Loop
    Close #1
    End Sub