RE: Network Path not found

From: Gary (gary@online.microsoft.com)
Date: 09/10/02


From: gary@online.microsoft.com (Gary)
Date: Tue, 10 Sep 2002 06:45:53 GMT


I have tested against the code below and it worked fine:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim sUsername As String = "***"
        Dim sPassword As String = "***"
        Dim oDirNTRoot As DirectoryEntry = New
DirectoryEntry("WinNT://sha-garygu-01", sUsername, sPassword)

        'Dim oUserDir As DirectoryEntry =
oDirNTRoot.Children.Find(sUsername, "user")
        Dim oGroupDir As DirectoryEntry =
oDirNTRoot.Children.Find("Administrators", "group")
        Dim oUserDir As DirectoryEntry = oDirNTRoot.Children.Find(sUsername
, "user")

        Dim bIsGroupMember As Boolean = False
        If oGroupDir.Name <> "" Then
            bIsGroupMember = oGroupDir.Invoke("IsMember", New Object()
{oUserDir.Path.ToString()})
        End If

    End Sub

Please tell me which code line causes the error? In addtioon, please post
here the contents of the web.config file.

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net