Results 1 to 3 of 3

Thread: Container Filter Help

  1. #1

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Container Filter Help

    Help needed with this code for .NET please:-

    The following code utilises ADSI and will work under VBScript

    Code:
    Dim Container As IADsContainer
    
    Container.Filter=Array("Computer")
    This will create a new Array with all of the Computer objects in the collection.

    How can I get the same result in VB .NET without having to use a For...Each statement (i.e) -

    Code:
    For Each LeafObject in Container
      If LeafObject.Class="Computer" Then 
         ' some code
      End If
    Next
    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.
    "I'm Brian and so is my Wife"

  2. #2

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307
    This problem has re-surfaced again (I used a workaround last time that's not applicable in my new app)...

    Does anybody know how to solve this???
    "I'm Brian and so is my Wife"

  3. #3

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307
    Scrub that last...

    ....does anybody have any good tutorials or documents that will show me how to use the System.DirectoryServices namespace...

    TIA.
    "I'm Brian and so is my Wife"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width