DirectoryServices

Jun 15 2004 7:47 AM
i have some problem with the code below, i able to get the workgroup name and computers connected under the workgroup but what i do not understand is , Is the WinNT is a directory?where can i find it in my system? i am using WINXP pro. Dim childEntry As DirectoryEntry Dim ParentEntry As New DirectoryEntry Try ParentEntry.Path = "WinNT:" For Each childEntry In ParentEntry.Children Dim newNode As New TreeNode(childEntry.Name) Select Case childEntry.SchemaClassName Case "Domain" Dim ParentDomain As New TreeNode(childEntry.Name) TreeView1.Nodes.AddRange(New TreeNode() {ParentDomain}) Dim SubChildEntry As DirectoryEntry Dim SubParentEntry As New DirectoryEntry SubParentEntry.Path = "WinNT://" & childEntry.Name For Each SubChildEntry In SubParentEntry.Children Dim newNode1 As New TreeNode(SubChildEntry.Name) Select Case SubChildEntry.SchemaClassName Case "Computer" ParentDomain.Nodes.Add(newNode1) End Select Next End Select Next Catch Excep As Exception MsgBox("Error While Reading Directories") Finally ParentEntry = Nothing End Try