public DirectoryEntry()
 {
     this.path = "";
     this.useCache = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.options = new DirectoryEntryConfiguration(this);
 }
 public DirectoryEntry()
 {
     this.path               = "";
     this.useCache           = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.options            = new DirectoryEntryConfiguration(this);
 }
 internal DirectoryEntry(object adsObject, bool useCache, string username, string password, AuthenticationTypes authenticationType, bool AdsObjIsExternal)
 {
     this.path               = "";
     this.useCache           = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.adsObject          = adsObject as System.DirectoryServices.Interop.UnsafeNativeMethods.IAds;
     if (this.adsObject == null)
     {
         throw new ArgumentException(Res.GetString("DSDoesNotImplementIADs"));
     }
     this.path               = this.adsObject.ADsPath;
     this.useCache           = useCache;
     this.authenticationType = authenticationType;
     this.credentials        = new NetworkCredential(username, password);
     if (username == null)
     {
         this.userNameIsNull = true;
     }
     if (password == null)
     {
         this.passwordIsNull = true;
     }
     if (!useCache)
     {
         this.CommitChanges();
     }
     this.options = new DirectoryEntryConfiguration(this);
     if (!AdsObjIsExternal)
     {
         this.InitADsObjectOptions();
     }
 }
Exemplo n.º 4
0
        internal DirectoryEntry(string path, bool useCache, string username, string password, AuthenticationTypes authenticationType)
        {
            _path        = path;
            _useCache    = useCache;
            _credentials = new NetworkCredential(username, password);
            if (username == null)
            {
                _userNameIsNull = true;
            }

            if (password == null)
            {
                _passwordIsNull = true;
            }

            _authenticationType = authenticationType;

            _options = new DirectoryEntryConfiguration(this);
        }
 internal DirectoryEntry(string path, bool useCache, string username, string password, AuthenticationTypes authenticationType)
 {
     this.path               = "";
     this.useCache           = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.path               = path;
     this.useCache           = useCache;
     this.credentials        = new NetworkCredential(username, password);
     if (username == null)
     {
         this.userNameIsNull = true;
     }
     if (password == null)
     {
         this.passwordIsNull = true;
     }
     this.authenticationType = authenticationType;
     this.options            = new DirectoryEntryConfiguration(this);
 }
Exemplo n.º 6
0
        internal DirectoryEntry(object adsObject, bool useCache, string username, string password, AuthenticationTypes authenticationType, bool AdsObjIsExternal)
        {
            _adsObject = adsObject as UnsafeNativeMethods.IAds;
            if (_adsObject == null)
            {
                throw new ArgumentException(SR.DSDoesNotImplementIADs);
            }

            // GetInfo is not needed here. ADSI executes an implicit GetInfo when GetEx
            // is called on the PropertyValueCollection. 0x800704BC error might be returned
            // on some WinNT entries, when iterating through 'Users' group members.
            // if (forceBind)
            //     this.adsObject.GetInfo();
            _path     = _adsObject.ADsPath;
            _useCache = useCache;

            _authenticationType = authenticationType;
            _credentials        = new NetworkCredential(username, password);
            if (username == null)
            {
                _userNameIsNull = true;
            }

            if (password == null)
            {
                _passwordIsNull = true;
            }

            if (!useCache)
            {
                CommitChanges();
            }

            _options = new DirectoryEntryConfiguration(this);

            // We are starting from an already bound connection so make sure the options are set properly.
            // If this is an externallly managed com object then we don't want to change it's current behavior
            if (!AdsObjIsExternal)
            {
                InitADsObjectOptions();
            }
        }
Exemplo n.º 7
0
 public DirectoryEntry()
 {
     _options = new DirectoryEntryConfiguration(this);
 }
Exemplo n.º 8
0
        internal DirectoryEntry(object adsObject, bool useCache, string username, string password, AuthenticationTypes authenticationType, bool AdsObjIsExternal)
        {
            _adsObject = adsObject as UnsafeNativeMethods.IAds;
            if (_adsObject == null)
                throw new ArgumentException(Res.GetString(Res.DSDoesNotImplementIADs));

            // GetInfo is not needed here. ADSI executes an implicit GetInfo when GetEx 
            // is called on the PropertyValueCollection. 0x800704BC error might be returned 
            // on some WinNT entries, when iterating through 'Users' group members.
            // if (forceBind)
            //     this.adsObject.GetInfo();                
            _path = _adsObject.ADsPath;
            _useCache = useCache;

            _authenticationType = authenticationType;
            _credentials = new NetworkCredential(username, password);
            if (username == null)
                _userNameIsNull = true;

            if (password == null)
                _passwordIsNull = true;

            if (!useCache)
                CommitChanges();

            _options = new DirectoryEntryConfiguration(this);

            // We are starting from an already bound connection so make sure the options are set properly.
            // If this is an externallly managed com object then we don't want to change it's current behavior
            if (!AdsObjIsExternal)
            {
                InitADsObjectOptions();
            }
        }
Exemplo n.º 9
0
        internal DirectoryEntry(string path, bool useCache, string username, string password, AuthenticationTypes authenticationType)
        {
            _path = path;
            _useCache = useCache;
            _credentials = new NetworkCredential(username, password);
            if (username == null)
                _userNameIsNull = true;

            if (password == null)
                _passwordIsNull = true;

            _authenticationType = authenticationType;

            _options = new DirectoryEntryConfiguration(this);
        }
Exemplo n.º 10
0
 /// <devdoc>
 /// Initializes a new instance of the <see cref='System.DirectoryServices.DirectoryEntry'/>class.
 /// </devdoc>
 public DirectoryEntry()
 {
     _options = new DirectoryEntryConfiguration(this);
 }
 internal DirectoryEntry(string path, bool useCache, string username, string password, AuthenticationTypes authenticationType)
 {
     this.path = "";
     this.useCache = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.path = path;
     this.useCache = useCache;
     this.credentials = new NetworkCredential(username, password);
     if (username == null)
     {
         this.userNameIsNull = true;
     }
     if (password == null)
     {
         this.passwordIsNull = true;
     }
     this.authenticationType = authenticationType;
     this.options = new DirectoryEntryConfiguration(this);
 }
 internal DirectoryEntry(object adsObject, bool useCache, string username, string password, AuthenticationTypes authenticationType, bool AdsObjIsExternal)
 {
     this.path = "";
     this.useCache = true;
     this.authenticationType = AuthenticationTypes.Secure;
     this.adsObject = adsObject as System.DirectoryServices.Interop.UnsafeNativeMethods.IAds;
     if (this.adsObject == null)
     {
         throw new ArgumentException(Res.GetString("DSDoesNotImplementIADs"));
     }
     this.path = this.adsObject.ADsPath;
     this.useCache = useCache;
     this.authenticationType = authenticationType;
     this.credentials = new NetworkCredential(username, password);
     if (username == null)
     {
         this.userNameIsNull = true;
     }
     if (password == null)
     {
         this.passwordIsNull = true;
     }
     if (!useCache)
     {
         this.CommitChanges();
     }
     this.options = new DirectoryEntryConfiguration(this);
     if (!AdsObjIsExternal)
     {
         this.InitADsObjectOptions();
     }
 }