I want to extract all the URLs of favorites.
Mine code is as below-
Code is adding all the Items into Listview. I want that on ListView_Click,dat site is opened.

Private Sub GetFavorites()

        Dim lvitem As ListViewItem
        Dim di As DirectoryInfo
        Dim lPos As Integer
        Dim sData As String
        Dim arrFi As FileInfo() = Nothing

        di = New DirectoryInfo(GetSpecialFolder(SPECIAL_FOLDER.FAVORITES))

        arrFi = di.GetFiles("*.*", SearchOption.AllDirectories)
        For Each fi As FileInfo In arrFi
            lPos = InStrRev(fi.FullName, "\", Len(fi.FullName))
            sData = Mid(fi.FullName, lPos + 1)
            sData = Replace(sData, ".url", "")
            GetIcon(fi.FullName)
            lvitem = LvwFavorites.Items.Add(sData, ImgIcons.Images.Count - 1)
            Application.DoEvents()
        Next
    End Sub

Then, what's the problem?
In ListView IndexChanged event handler

If listView1.SelectedItems.Count > 0
System.Diagnostics.Process.Start(listView1.SelectedItems(0).Text)

P.S: I don't code in VB.NET, if there's any syntax error please try to solve it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.