AnsweredAssumed Answered

.NET in VEE

Question asked by harvey on Sep 21, 2011
Latest reply on Sep 25, 2011 by changmeikuan
Try as I might I am not able to get the .NET code I want working in VEE. I am trying to get a list of network computers in a vee program, I have tried 2 methods, 1) importing  Netapi32.dll and using  NetserverEnum method  and 2) the .NET System.DirectoryServices.DirectoryEntry method.
The problem is that whilst I'm reasonably OK with Vee, I'm not a C# / .NET / C++ etc programmer. I have tried many ways to get this working and have tried to research the answer but I cannot find what I am doing wrong.
So, I am just going to ask straight out, can any provide me with pointers, hints / tips or better still a sample Vee program that will achieve the same as the following code.

Sub Main()
        Dim root As New DirectoryEntry("WinNT:")
        Dim parent As DirectoryServices.DirectoryEntries
        parent = root.Children
        Dim d As DirectoryEntries = parent
        For Each complist As DirectoryEntry In parent
            For Each c As DirectoryEntry In complist.Children
                If (c.Name <> "Schema") Then
                    Console.WriteLine(c.Name)
                End If
            Next
        Next
    End Sub

Many thanks in advance,

Harvey  

Outcomes