help me understand this code
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts
Page 1 of 1
i have this code (NOT MINE)
and i call that sub with the following code by using a background worker
my question: WHY dunnno;
Code: Select all
to display a list of folders and subfolders Public Sub SubFoldersRecursive(ByVal Root As DirectoryInfo, ByRef Status As String)
Try
Status += Root.FullName + vbNewLine
If (Root.GetDirectories.Length <= 0) Then
Exit Sub
End If
Dim SD As DirectoryInfo
For Each SD In Root.GetDirectories
If SD.Attributes = FileAttributes.Directory Then
SubFoldersRecursive(SD, Status)
End If
Next
Catch ex As Exception
Status += ex.Message + vbNewLine
End Try
End Sub
and i call that sub with the following code by using a background worker
Code: Select all
now the problem is that when i start the worker it duplicates all the items in the listviewDim T As String = ""
Dim R As New DirectoryInfo("D:\")
Call SubFoldersRecursive(R, T)
dim g as new listview item
g.text = t
listview1.items.add(g)
my question: WHY dunnno;
You can find me on Facebook or on Skype mihai_92b
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023