Поделиться через


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.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs

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

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

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

DirectoryEntry(Object)

Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs

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

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

DirectoryEntry(String)

Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs

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

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

DirectoryEntry(String, String, String)

Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs
Исходный код:
DirectoryEntry.cs

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

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

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

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