I\'m connecting to a LDAP directory in C#, so I\'ve used the DirectoryEntry class.
When you do the \"new DirectoryEntry\" with address, login, and password it is sup
Just "newing" up a DirectoryEntry does NOT create a connection to the LDAP store.
Only once you start using its properties, or when you access the .NativeObject
property explicitly, you'll actually get a connection to the LDAP store.
In order to make sure you're connected, just read out the (DirectoryEntry).NativeObject
in a try...catch clause - if it bombs out, you have a problem, otherwise your connection is now up and active.
Unfortunately, to my knowledge, there is no property or method you can call to figure out whether or not you've successfully connected to LDAP using DirectoryEntry.
Marc