示例#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);
        }