Help needed with this code for .NET please:-
The following code utilises ADSI and will work under VBScript
This will create a new Array with all of the Computer objects in the collection.Code:Dim Container As IADsContainer Container.Filter=Array("Computer")
How can I get the same result in VB .NET without having to use a For...Each statement (i.e) -
The assignment to the Array in the first code segment fails under .NET with an 'Array is a type and cannot be used as an expression'. All help gratefully recieved.Code:For Each LeafObject in Container If LeafObject.Class="Computer" Then ' some code End If Next




Reply With Quote