I need some help with this script. It's not working....
VB Code:
Private Sub LoadFavorites() 'Set up the treeview tvFavorites.Nodes.Clear() tvFavorites.Nodes.Add("Favorites") tvFavorites.Nodes(0).ImageIndex = 10 tvFavorites.Nodes(0).SelectedImageIndex = 10 Dim FavPath() As String Dim strsplit() As String Dim strFav As String Dim i As Short Dim oNode As TreeNode Try 'Load Folders from Favorites Root FavPath = Directory.GetDirectories(GetFolderPath(SpecialFolder.Favorites)) For Each strFav In FavPath oNode = New TreeNode strsplit = Split(strFav, "\", , CompareMethod.Text) i = UBound(strsplit) oNode.ImageIndex = 18 oNode.SelectedImageIndex = 19 oNode.Text = strsplit(i) oNode.Tag = strFav tvFavorites.Nodes(0).Nodes.Add(oNode) LoadSubFolders(oNode, strFav) Next FavPath = Directory.GetFiles(GetFolderPath(SpecialFolder.Favorites)) For Each strFav In FavPath If InStr(strFav, ".ini", CompareMethod.Text) Then Else oNode = New TreeNode Dim oFile As New FileInfo(strFav) strsplit = Split(oFile.Name, ".url", , CompareMethod.Text) oNode.Text = strsplit(0) oNode.ImageIndex = 16 oNode.SelectedImageIndex = 16 oNode.Tag = GetUrl(strFav) tvFavorites.Nodes(0).Nodes.Add(oNode) End If Next Catch ex As Exception Catch ex As DirectoryNotFoundException Catch ex As IO.IOException End Try oNode = Nothing End Sub




Reply With Quote