Try ParentEntry.Path = "WinNT:" For Each childEntry In ParentEntry.Children Select Case childEntry.SchemaClassName Case "Domain" SubParentEntry.Path = "WinNT://" & childEntry.Name For Each SubChildEntry In SubParentEntry.Children Select Case SubChildEntry.SchemaClassName Case "Computer" LBox.Items.Add(SubChildEntry.Name) End Select Next End Select Next Catch Excep As Exception MsgBox("Error While Reading Directories") Finally ParentEntry = Nothing End Try
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ListBox1.Items.Add("First Item") ListBox1.Items.Add("Second Item") ListBox1.Items.Add("Third Item") ListBox1.Items.Add("Fourth Item") ListBox1.SelectedIndex = 0 Timer1.Interval = 500 Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim i As Integer i = ListBox1.SelectedIndex i = i + 1 If i > ListBox1.Items.Count - 1 Then i = 0 ListBox1.SelectedIndex = i End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)