DirectoryEntry.Password Свойство

Определение

Задает пароль, используемый при проверке подлинности клиента.

public:
 property System::String ^ Password {  void set(System::String ^ value); };
public:
 property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
public string? Password { set; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSPassword")]
public string Password { get; set; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSPassword")]
public string Password { set; }
public string Password { set; }
member this.Password : string
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSPassword")>]
member this.Password : string with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSPassword")>]
member this.Password : string
Public Property Password As String

Значение свойства

Пароль, используемый при проверке подлинности клиента.

Атрибуты

Примеры

В следующем примере показано, Username как Password и свойства DirectoryEntry класса. В этом примере возвращается указанный DirectoryEntry пользователем и Path все его Children.

Dim myADSPath As String = _
      "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"

' Create an Instance of DirectoryEntry.
Dim myDirectoryEntry As New DirectoryEntry(myADSPath)
myDirectoryEntry.Username = UserName
myDirectoryEntry.Password = SecurelyStoredPassword

' Get the Child ADS objects.
Console.WriteLine("The Child ADS objects are:")
Dim myChildDirectoryEntry As DirectoryEntry
For Each myChildDirectoryEntry In  myDirectoryEntry.Children
   Console.WriteLine(myChildDirectoryEntry.Path)
Next myChildDirectoryEntry
String myADSPath = "LDAP://onecity/CN=Users,
         DC=onecity,DC=corp,DC=fabrikam,DC=com";

// Create an Instance of DirectoryEntry.
DirectoryEntry myDirectoryEntry = new DirectoryEntry(myADSPath);
myDirectoryEntry.Username = UserName;
myDirectoryEntry.Password = SecurelyStoredPassword;

// Get the Child ADS objects.
Console.WriteLine("The Child ADS objects are:");
foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children)
   Console.WriteLine(myChildDirectoryEntry.Path);

Комментарии

Можно задать свойства Username и Password, чтобы указать альтернативные учетные данные, с помощью которых можно получить доступ к данным в доменные службы Active Directory. Все другие DirectoryEntry объекты, полученные из этого экземпляра (например, через Children) автоматически создаются с теми же альтернативными учетными данными.

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

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