Beispiel #1
0
        public ConectLdap()
        {
            ldap = new ReadWriterConfig().ReadConfigLdap();
            string path = ldap.UrlLdap + "/" + ldap.BindLdap;

            entry = new DirectoryEntry(path, ldap.BindDn, ldap.BindCredential, AuthenticationTypes.FastBind);
        }
Beispiel #2
0
        public bool Connect(LdapField ldap)
        {
            bool result = false;

            try
            {
                string path = ldap.UrlLdap + "/" + ldap.BindLdap;
                entry = new DirectoryEntry(path, ldap.BindDn, ldap.BindCredential, AuthenticationTypes.FastBind);
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Beispiel #3
0
        public bool checkLdapServer(LdapField ldap)
        {
            bool result = false;

            try
            {
                string         path           = ldap.UrlLdap + "/" + ldap.BindLdap;
                DirectoryEntry directoryEntry = new DirectoryEntry(path, userName, password, AuthenticationTypes.FastBind);
                object         nativeObject   = directoryEntry.NativeObject;
                result = true;
            }
            catch (DirectoryServicesCOMException)
            {
            }
            return(result);
        }
Beispiel #4
0
        public bool Connect()
        {
            bool result = true;

            try
            {
                ldap = new ReadWriterConfig().ReadConfigLdap();
                string path = ldap.UrlLdap + "/" + ldap.BindLdap;
                entry = new DirectoryEntry(path, ldap.BindDn, ldap.BindCredential, AuthenticationTypes.FastBind);
            }
            catch
            {
                result = false;
            }
            return(result);
        }