How to know if my DirectoryEntry is really connected to my LDAP directory?
问题 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 supposed to connect to the LDAP directory. However, even if the connection didn't work, it returns without problem, and the directoryentry variable is set. So i do i know my connection is really opened ? Right now, I'm using a very very ugly hack : i put a "if(mydirectory.SchemaEntry)" which generates an exception if the connection wasn