C
Chris Roth
Hi All,
Anybody know the best way to detect if network / Active Directory is
present? I'm programming in VB.NET, and my customers often use laptops,
which can be disconnected from the .NET. I need to detect this in order to
be "well behaved."
I've tried putting LDAP://RootDSE in a directory entry constructor. This
works fine in a try catch block, but it is very slow when the net is not
present:
Try
Dim de As New DirectoryEntry("LDAP://RootDSE")
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
I tried using the shared method in the DirectoryEntry class to "pre-detect"
If DirectoryEntry.Exists("LDAP://rootDSE") Then ...
but this throws an error when searching for the root - back to square one -
try-catch block, and slow.
Thanks,
Chris.
Anybody know the best way to detect if network / Active Directory is
present? I'm programming in VB.NET, and my customers often use laptops,
which can be disconnected from the .NET. I need to detect this in order to
be "well behaved."
I've tried putting LDAP://RootDSE in a directory entry constructor. This
works fine in a try catch block, but it is very slow when the net is not
present:
Try
Dim de As New DirectoryEntry("LDAP://RootDSE")
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
I tried using the shared method in the DirectoryEntry class to "pre-detect"
If DirectoryEntry.Exists("LDAP://rootDSE") Then ...
but this throws an error when searching for the root - back to square one -
try-catch block, and slow.
Thanks,
Chris.