Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Sub btnList_Click(sender As Object, e As EventArgs)
- Dim sb As New StringBuilder()
- Dim dir As New DirectoryEntry
- Dim list As New List(Of String)
- ReadRecurs(dir.Children(1), list)
- list.Sort()
- For Each str As String In list
- sb.Append(str)
- Next
- divList.InnerHtml = sb.ToString
- End Sub
- Private Sub ReadRecurs(ByVal entries As DirectoryEntry, ByVal list As List(Of String))
- For Each ent As DirectoryEntry In entries.Children
- If ent.Children IsNot Nothing Then
- ReadRecurs(ent, list)
- End If
- If ent.SchemaClassName = "computer" Then
- list.Add(ent.Name & ", " & ent.Path & "<div />")
- End If
- ent.Dispose()
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement