0

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
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.