Hi!
In my application i wrote code to find all systems connected in LAN.But it return some systems only. this is the code
Dim childEntry As DirectoryEntry
Dim ParentEntry As New DirectoryEntry( )
Try
ParentEntry.Pat h = "WinNT:"
For Each childEntry In ParentEntry.Chi ldren
Dim newNode As New TreeNode(childE ntry.Name)
Select Case childEntry.Sche maClassName
Case "Domain"
Dim ParentDomain As New TreeNode(childE ntry.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(SubChi ldEntry.Name)
Select Case SubChildEntry.S chemaClassName
Case "Computer"
ParentDomain.No des.Add(newNode 1)
End Select
Next
End Select
Next
Catch Excep As Exception
MsgBox("Error While Reading Directories")
Finally
ParentEntry = Nothing
End Try
In that the
SubChildEntry.S chemaClassName its return value like "Schema" instead of "Computers" .For this i'm not able to list out all systems in my LAN.
Can anyone give solution for this .plz
Regards,
Anand.M
In my application i wrote code to find all systems connected in LAN.But it return some systems only. this is the code
Dim childEntry As DirectoryEntry
Dim ParentEntry As New DirectoryEntry( )
Try
ParentEntry.Pat h = "WinNT:"
For Each childEntry In ParentEntry.Chi ldren
Dim newNode As New TreeNode(childE ntry.Name)
Select Case childEntry.Sche maClassName
Case "Domain"
Dim ParentDomain As New TreeNode(childE ntry.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(SubChi ldEntry.Name)
Select Case SubChildEntry.S chemaClassName
Case "Computer"
ParentDomain.No des.Add(newNode 1)
End Select
Next
End Select
Next
Catch Excep As Exception
MsgBox("Error While Reading Directories")
Finally
ParentEntry = Nothing
End Try
In that the
SubChildEntry.S chemaClassName its return value like "Schema" instead of "Computers" .For this i'm not able to list out all systems in my LAN.
Can anyone give solution for this .plz
Regards,
Anand.M
Comment