ActiveDirectoryMembershipProvider.GetUser Método

Definição

Obtém as informações de um usuário associado no armazenamento de dados do Active Directory.Gets the information from a membership user in the Active Directory data store.

Sobrecargas

GetUser(String, Boolean)

Obtém as informações de usuário associado relacionadas ao nome de usuário especificado.Gets the membership user information associated with the specified user name.

GetUser(Object, Boolean)

Obtém as informações de usuário associado relacionadas à chave de usuário especificada.Gets the membership user information associated with the specified user key.

GetUser(String, Boolean)

Obtém as informações de usuário associado relacionadas ao nome de usuário especificado.Gets the membership user information associated with the specified user name.

public:
 override System::Web::Security::MembershipUser ^ GetUser(System::String ^ username, bool userIsOnline);
public override System.Web.Security.MembershipUser GetUser (string username, bool userIsOnline);
override this.GetUser : string * bool -> System.Web.Security.MembershipUser
Public Overrides Function GetUser (username As String, userIsOnline As Boolean) As MembershipUser

Parâmetros

username
String

O nome do usuário para o qual obter informações.The name of the user to get information for.

userIsOnline
Boolean

O método GetUser(String, Boolean) ignora esse parâmetro.The GetUser(String, Boolean) method ignores this parameter.

Retornos

MembershipUser

Uma instância MembershipUser que representa o usuário especificado.A MembershipUser instance representing the user specified. Se nenhum usuário for encontrado no armazenamento de dados do Active Directory para o valor username especificado, null será retornado.If no user is found in the Active Directory data store for the specified username value, null is returned.

Exceções

username está vazio ou excede o comprimento máximo do nome de usuário (normalmente de 256 caracteres).username is empty, or exceeds the maximum length for the user name (usually 256 characters).

- ou --or- username contém vírgulas.username contains commas.

- ou --or- O nome de usuário é mapeado para o atributo userPrincipalName e o parâmetro username contém barras invertidas.The user name is mapped to the userPrincipalName attribute and the username parameter contains backslashes.

username é null.username is null.

O método GetUser(String, Boolean) é chamado antes que a instância ActiveDirectoryMembershipProvider seja inicializada.The GetUser(String, Boolean) method is called before the ActiveDirectoryMembershipProvider instance is initialized.

Comentários

O GetUser método é chamado pela Membership classe para recuperar informações sobre o usuário especificado do armazenamento de dados Active Directory.The GetUser method is called by the Membership class to retrieve information on the specified user from the Active Directory data store.

O provedor usa uma pesquisa de subárvore iniciada no ponto de pesquisa especificado na cadeia de conexão.The provider uses a subtree search starting at the search point specified in the connection string. Consulte o ActiveDirectoryMembershipProvider tópico de classe para obter mais informações sobre cadeias de conexão.See the ActiveDirectoryMembershipProvider class topic for more information about connection strings.

Os espaços à esquerda e à direita são cortados do valor de parâmetro username.Leading and trailing spaces are trimmed from the username parameter value.

Aplica-se a

GetUser(Object, Boolean)

Obtém as informações de usuário associado relacionadas à chave de usuário especificada.Gets the membership user information associated with the specified user key.

public:
 override System::Web::Security::MembershipUser ^ GetUser(System::Object ^ providerUserKey, bool userIsOnline);
public override System.Web.Security.MembershipUser GetUser (object providerUserKey, bool userIsOnline);
override this.GetUser : obj * bool -> System.Web.Security.MembershipUser
Public Overrides Function GetUser (providerUserKey As Object, userIsOnline As Boolean) As MembershipUser

Parâmetros

providerUserKey
Object

O identificador exclusivo para o usuário.The unique identifier for the user.

userIsOnline
Boolean

O método GetUser(Object, Boolean) ignora esse parâmetro.The GetUser(Object, Boolean) method ignores this parameter.

Retornos

MembershipUser

Uma instância MembershipUser que representa o usuário especificado.A MembershipUser instance representing the user specified. Se nenhum usuário for encontrado no armazenamento de dados do Active Directory para o valor providerUserKey especificado, null será retornado.If no user is found in the Active Directory data store for the specified providerUserKey value, null is returned.

Exceções

O método GetUser(Object, Boolean) é chamado antes que a instância ActiveDirectoryMembershipProvider seja inicializada.The GetUser(Object, Boolean) method is called before the ActiveDirectoryMembershipProvider instance is initialized.

providerUserKey não é do tipo SecurityIdentifier.providerUserKey is not of type SecurityIdentifier.

providerUserKey é null.providerUserKey is null.

Comentários

O GetUser método é chamado pela Membership classe para recuperar informações sobre o usuário especificado do armazenamento de dados Active Directory.The GetUser method is called by the Membership class to retrieve information on the specified user from the Active Directory data store.

A pesquisa procura uma instância de usuário na qual o objectSID atributo corresponde ao providerUserKey parâmetro.The search looks for a user instance where the objectSID attribute matches the providerUserKey parameter.

O provedor usa uma pesquisa de subárvore iniciada no ponto de pesquisa especificado na cadeia de conexão.The provider uses a subtree search starting at the search point specified in the connection string. Consulte o ActiveDirectoryMembershipProvider tópico de classe para obter mais informações sobre cadeias de conexão.See the ActiveDirectoryMembershipProvider class topic for more information about connection strings.

Aplica-se a