DirectoryEntry Конструкторы

Определение

Инициализирует новый экземпляр класса DirectoryEntry.

Перегрузки

DirectoryEntry()

Инициализирует новый экземпляр класса DirectoryEntry.

DirectoryEntry(Object)

Инициализирует новый экземпляр класса DirectoryEntry, который привязывается к указанному собственному объекту доменных служб Active Directory.

DirectoryEntry(String)

Инициализирует новый экземпляр класса DirectoryEntry, который привязывает этот экземпляр к узлу доменных служб Active Directory, расположенному по указанному пути.

DirectoryEntry(String, String, String)

Инициализирует новый экземпляр класса DirectoryEntry.

DirectoryEntry(String, String, String, AuthenticationTypes)

Инициализирует новый экземпляр класса DirectoryEntry.

DirectoryEntry()

Инициализирует новый экземпляр класса DirectoryEntry.

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

Применяется к

DirectoryEntry(Object)

Инициализирует новый экземпляр класса DirectoryEntry, который привязывается к указанному собственному объекту доменных служб Active Directory.

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

Параметры

adsObject
Object

Имя собственного объекта доменных служб Active Directory, к которому осуществляется привязка.

Комментарии

Этот конструктор позволяет программе использовать методы и свойства DirectoryEntry класса в собственном объекте доменные службы Active Directory, который реализует интерфейс IADs через собственный API. Дополнительные сведения об интерфейсе IADs см. в статье об идентификаторах IAD.

Применяется к

DirectoryEntry(String)

Инициализирует новый экземпляр класса DirectoryEntry, который привязывает этот экземпляр к узлу доменных служб Active Directory, расположенному по указанному пути.

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)

Параметры

path
String

Путь, по которому требуется привязать DirectoryEntry(String) к каталогу. Этим значением инициализируется свойство Path.

Примеры

В следующем примере объект привязывается DirectoryEntry к записи каталога по указанному пути и отображается Path свойство каждой дочерней записи, указанной свойством узла 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);  
    }  
}  

Применяется к

DirectoryEntry(String, String, String)

Инициализирует новый экземпляр класса 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)

Параметры

path
String

Путь к данному объекту DirectoryEntry. Этим значением инициализируется свойство Path.

username
String

Имя пользователя, используемое при проверке подлинности клиента. Этим значением инициализируется свойство Username.

password
String

Пароль, используемый при аутентификации клиента. Этим значением инициализируется свойство Password.

Применяется к

DirectoryEntry(String, String, String, AuthenticationTypes)

Инициализирует новый экземпляр класса 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)

Параметры

path
String

Путь к данному объекту DirectoryEntry. Этим значением инициализируется свойство Path.

username
String

Имя пользователя, используемое при проверке подлинности клиента. Этим значением инициализируется свойство Username.

password
String

Пароль, используемый при аутентификации клиента. Этим значением инициализируется свойство Password.

authenticationType
AuthenticationTypes

Одно из значений перечисления AuthenticationTypes. Этим значением инициализируется свойство AuthenticationType.

См. также раздел

Применяется к