DirectoryEntry Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy DirectoryEntry.

Przeciążenia

DirectoryEntry()

Inicjuje nowe wystąpienie klasy DirectoryEntry.

DirectoryEntry(Object)

Inicjuje DirectoryEntry nowe wystąpienie klasy powiązanej z określonym natywnym obiektem Active Directory Domain Services.

DirectoryEntry(String)

Inicjuje DirectoryEntry nowe wystąpienie klasy, która wiąże to wystąpienie z węzłem w Active Directory Domain Services znajdującym się w określonej ścieżce.

DirectoryEntry(String, String, String)

Inicjuje nowe wystąpienie klasy DirectoryEntry.

DirectoryEntry(String, String, String, AuthenticationTypes)

Inicjuje nowe wystąpienie klasy DirectoryEntry.

DirectoryEntry()

Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs

Inicjuje nowe wystąpienie klasy DirectoryEntry.

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

Dotyczy

DirectoryEntry(Object)

Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs

Inicjuje DirectoryEntry nowe wystąpienie klasy powiązanej z określonym natywnym obiektem Active Directory Domain Services.

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

Parametry

adsObject
Object

Nazwa natywnego obiektu Active Directory Domain Services, z który ma być powiązany.

Uwagi

Ten konstruktor umożliwia programowi używanie metod i właściwości DirectoryEntry klasy na natywnym obiekcie Active Directory Domain Services, który implementuje interfejs IADs za pośrednictwem natywnego interfejsu API. Aby uzyskać więcej informacji na temat interfejsu IADs, zobacz artykuł IADs (IADs ).

Dotyczy

DirectoryEntry(String)

Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs

Inicjuje DirectoryEntry nowe wystąpienie klasy, która wiąże to wystąpienie z węzłem w Active Directory Domain Services znajdującym się w określonej ścieżce.

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

Parametry

path
String

Ścieżka, w której ma być powiązana z DirectoryEntry(String) katalogem. Właściwość Path jest inicjowana do tej wartości.

Przykłady

Poniższy przykład wiąże obiekt z wpisem DirectoryEntry katalogu w określonej ścieżce i wyświetla Path właściwość każdego wpisu podrzędnego określonego przez właściwość węzła Children .

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);  
    }  
}  

Dotyczy

DirectoryEntry(String, String, String)

Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs

Inicjuje nowe wystąpienie klasy DirectoryEntry.

public:
 DirectoryEntry(System::String ^ path, System::String ^ username, System::String ^ password);
public DirectoryEntry (string path, string username, 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)

Parametry

path
String

Ścieżka tego DirectoryEntryelementu . Właściwość Path jest inicjowana do tej wartości.

username
String

Nazwa użytkownika używana podczas uwierzytelniania klienta. Właściwość Username jest inicjowana do tej wartości.

password
String

Hasło do użycia podczas uwierzytelniania klienta. Właściwość Password jest inicjowana do tej wartości.

Dotyczy

DirectoryEntry(String, String, String, AuthenticationTypes)

Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs
Źródło:
DirectoryEntry.cs

Inicjuje nowe wystąpienie klasy DirectoryEntry.

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);
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)

Parametry

path
String

Ścieżka tego DirectoryEntryelementu . Właściwość Path jest inicjowana do tej wartości.

username
String

Nazwa użytkownika używana podczas uwierzytelniania klienta. Właściwość Username jest inicjowana do tej wartości.

password
String

Hasło do użycia podczas uwierzytelniania klienta. Właściwość Password jest inicjowana do tej wartości.

authenticationType
AuthenticationTypes

AuthenticationTypes Jedna z wartości. Właściwość AuthenticationType jest inicjowana do tej wartości.

Zobacz też

Dotyczy