DirectoryEntry.Password Özellik

Tanım

İstemcinin kimliğini doğrularken kullanılacak parolayı ayarlar.

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

Özellik Değeri

İstemcinin kimliğini doğrularken kullanılacak parola.

Öznitelikler

Örnekler

Aşağıdaki örnekte sınıfının ve Password özellikleri gösterilmektedir.UsernameDirectoryEntry Bu örnek, kullanıcı tarafından belirtilen DirectoryEntry ve Path tüm öğesini Childrenalır.

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);  
String^ myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";  

// Create an Instance of DirectoryEntry.  
DirectoryEntry^ myDirectoryEntry = gcnew DirectoryEntry(myADSPath);  
myDirectoryEntry->Username = UserName;  
myDirectoryEntry->Password = SecurelyStoredPassword;  

// Get the Child ADS objects.  
Console::WriteLine("The Child ADS objects are:");  
Collections::IEnumerator^ myEnum = myDirectoryEntry->Children->GetEnumerator();  
while (myEnum->MoveNext())   
{  
    DirectoryEntry^ myChildDirectoryEntry = safe_cast<DirectoryEntry^>  
             (myEnum->Current);  
    Console::WriteLine(myChildDirectoryEntry->Path);  
}  

Açıklamalar

ve Password özelliklerini, Active Directory Domain Services bilgilerine erişecek alternatif kimlik bilgilerini belirtecek şekilde ayarlayabilirsinizUsername. Bu örnekten alınan diğer DirectoryEntry nesneler (örneğin, aracılığıyla Children) aynı alternatif kimlik bilgileriyle otomatik olarak oluşturulur.

Şunlara uygulanır

Ayrıca bkz.