DirectoryEntry DirectoryEntry DirectoryEntry DirectoryEntry Constructors

Definición

Sobrecargas

DirectoryEntry() DirectoryEntry() DirectoryEntry()

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

DirectoryEntry(Object) DirectoryEntry(Object) DirectoryEntry(Object) DirectoryEntry(Object)

Inicializa una nueva instancia de la clase DirectoryEntry que enlaza al objeto nativo de Active Directory Domain Services especificado. Initializes a new instance of the DirectoryEntry class that binds to the specified native Active Directory Domain Services object.

DirectoryEntry(String) DirectoryEntry(String) DirectoryEntry(String) DirectoryEntry(String)

Inicializa una nueva instancia de la clase DirectoryEntry que enlaza esta instancia al nodo de Active Directory Domain Services ubicado en la ruta de acceso especificada. Initializes a new instance of the DirectoryEntry class that binds this instance to the node in Active Directory Domain Services located at the specified path.

DirectoryEntry(String, String, String) DirectoryEntry(String, String, String) DirectoryEntry(String, String, String) DirectoryEntry(String, String, String)

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes)

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

DirectoryEntry() DirectoryEntry() DirectoryEntry()

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

public:
 DirectoryEntry();
public DirectoryEntry ();
Public Sub New ()

Seguridad

DirectoryServicesPermission
Demand

DirectoryEntry(Object) DirectoryEntry(Object) DirectoryEntry(Object) DirectoryEntry(Object)

Inicializa una nueva instancia de la clase DirectoryEntry que enlaza al objeto nativo de Active Directory Domain Services especificado. Initializes a new instance of the DirectoryEntry class that binds to the specified native Active Directory Domain Services object.

public:
 DirectoryEntry(System::Object ^ adsObject);
public DirectoryEntry (object adsObject);
new System.DirectoryServices.DirectoryEntry : obj -> System.DirectoryServices.DirectoryEntry
Public Sub New (adsObject As Object)
Parámetros
adsObject
Object Object Object Object

Nombre del objeto nativo de Active Directory Domain Services al que se va a enlazar. The name of the native Active Directory Domain Services object to bind to.

Comentarios

Este constructor permite que un programa para utilizar los métodos y propiedades de la DirectoryEntry clase en un objeto nativo de Active Directory Domain Services que implementa la interfaz IADs a través de una API nativa.This constructor enables a program to use the methods and properties of the DirectoryEntry class on a native Active Directory Domain Services object that implements the IADs interface through a native API. Para obtener más información acerca de la interfaz de IAD, vea el tema IADs en MSDN Library en http://msdn.microsoft.com/library .For more information about the IADs interface, see the topic IADs in the MSDN Library at http://msdn.microsoft.com/library.

Seguridad

DirectoryServicesPermission
Demand

DirectoryEntry(String) DirectoryEntry(String) DirectoryEntry(String) DirectoryEntry(String)

Inicializa una nueva instancia de la clase DirectoryEntry que enlaza esta instancia al nodo de Active Directory Domain Services ubicado en la ruta de acceso especificada. Initializes a new instance of the DirectoryEntry class that binds this instance to the node in Active Directory Domain Services located at the specified path.

public:
 DirectoryEntry(System::String ^ path);
public DirectoryEntry (string path);
new System.DirectoryServices.DirectoryEntry : string -> System.DirectoryServices.DirectoryEntry
Public Sub New (path As String)
Parámetros
path
String String String String

Ruta de acceso en la que se va a enlazar DirectoryEntry(String) al directorio. The path at which to bind the DirectoryEntry(String) to the directory. La propiedad Path se inicializa en este valor. The Path property is initialized to this value.

Ejemplos

En el ejemplo siguiente se enlaza un DirectoryEntry objeto a la entrada de directorio en la ruta de acceso especificada y muestra el Path propiedad de cada entrada secundaria especificada por el nodo Children propiedad.The following example binds a DirectoryEntry object to the directory entry at the specified path, and displays the Path property of each child entry that is specified by the node's Children property.

Public Class PrintChildren  

    'Entry point which delegates to C-style main Private Function.  
    Public Overloads Shared Sub Main()  
        Main(System.Environment.GetCommandLineArgs())  
    End Sub  

    Overloads Public Shared Sub Main(args() As String)  
        Dim objDE As DirectoryEntry  
        Dim strPath As String = "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com"  
        If args.Length > 0 Then  
            strPath = args(1)  
        End If   
        ' Create a new DirectoryEntry with the given path.  
        objDE = New DirectoryEntry(strPath)  

        Dim objChildDE As DirectoryEntry  
        For Each objChildDE In  objDE.Children  
            Console.WriteLine(objChildDE.Path)  
        Next objChildDE  
    End Sub 'Main  
End Class 'PrintChildren  
public class PrintChildren{  
   public static void Main(String[] args)  
   {  
      DirectoryEntry objDE;  
      String strPath="LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com";  
      if(args.Length>0)strPath=args[1];  

      // Create a new DirectoryEntry with the given path.  
      objDE=new DirectoryEntry(strPath);  

      foreach(DirectoryEntry objChildDE in objDE.Children)  
        Console.WriteLine(objChildDE.Path);  
   }  
 }  
int main()  
{  
    String^ args[] = Environment::GetCommandLineArgs();  
    DirectoryEntry^ objDE;  
    String^ strPath = "LDAP://DC=onecity,DC=corp,DC=fabrikam,DC=com";  
    if(args->Length>1)  
    {  
        strPath=args[1];  
    }  

    // Create a new DirectoryEntry with the given path.  
    objDE = gcnew DirectoryEntry(strPath);  

    System::Collections::IEnumerator^ enum0 = objDE->Children->GetEnumerator();  
    while (enum0->MoveNext())  
    {  
        DirectoryEntry^ objChildDE = safe_cast<DirectoryEntry^>(enum0->Current);  
        Console::WriteLine(objChildDE->Path);  
    }  
}  

Seguridad

DirectoryServicesPermission
Demand

DirectoryEntry(String, String, String) DirectoryEntry(String, String, String) DirectoryEntry(String, String, String) DirectoryEntry(String, String, String)

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

public:
 DirectoryEntry(System::String ^ path, System::String ^ username, System::String ^ password);
public DirectoryEntry (string path, string username, string password);
new System.DirectoryServices.DirectoryEntry : string * string * string -> System.DirectoryServices.DirectoryEntry
Public Sub New (path As String, username As String, password As String)
Parámetros
path
String String String String

Ruta de acceso de este objeto DirectoryEntry. The path of this DirectoryEntry. La propiedad Path se inicializa en este valor. The Path property is initialized to this value.

username
String String String String

Nombre de usuario que se va a usar para autenticar el cliente. The user name to use when authenticating the client. La propiedad Username se inicializa en este valor. The Username property is initialized to this value.

password
String String String String

Contraseña que se va a usar para autenticar el cliente. The password to use when authenticating the client. La propiedad Password se inicializa en este valor. The Password property is initialized to this value.

Seguridad

DirectoryServicesPermission
Demand

DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes) DirectoryEntry(String, String, String, AuthenticationTypes)

Inicializa una nueva instancia de la clase DirectoryEntry. Initializes a new instance of the DirectoryEntry class.

public:
 DirectoryEntry(System::String ^ path, System::String ^ username, System::String ^ password, System::DirectoryServices::AuthenticationTypes authenticationType);
public DirectoryEntry (string path, string username, string password, System.DirectoryServices.AuthenticationTypes authenticationType);
new System.DirectoryServices.DirectoryEntry : string * string * string * System.DirectoryServices.AuthenticationTypes -> System.DirectoryServices.DirectoryEntry
Public Sub New (path As String, username As String, password As String, authenticationType As AuthenticationTypes)
Parámetros
path
String String String String

Ruta de acceso de este objeto DirectoryEntry. The path of this DirectoryEntry. La propiedad Path se inicializa en este valor. The Path property is initialized to this value.

username
String String String String

Nombre de usuario que se va a usar para autenticar el cliente. The user name to use when authenticating the client. La propiedad Username se inicializa en este valor. The Username property is initialized to this value.

password
String String String String

Contraseña que se va a usar para autenticar el cliente. The password to use when authenticating the client. La propiedad Password se inicializa en este valor. The Password property is initialized to this value.

authenticationType
AuthenticationTypes AuthenticationTypes AuthenticationTypes AuthenticationTypes

Uno de los valores de AuthenticationTypes. One of the AuthenticationTypes values. La propiedad AuthenticationType se inicializa en este valor. The AuthenticationType property is initialized to this value.

Seguridad

DirectoryServicesPermission
Demand

Consultar también

Se aplica a