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

            entry = new DirectoryEntry(path, ldap.BindDn, ldap.BindCredential, AuthenticationTypes.FastBind);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }