GenericPrincipal.IsInRole(String) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Determina se a corrente GenericPrincipal pertence ao papel especificado.
public:
override bool IsInRole(System::String ^ role);
public:
virtual bool IsInRole(System::String ^ role);
public override bool IsInRole(string role);
public override bool IsInRole(string? role);
public virtual bool IsInRole(string role);
override this.IsInRole : string -> bool
abstract member IsInRole : string -> bool
override this.IsInRole : string -> bool
Public Overrides Function IsInRole (role As String) As Boolean
Public Overridable Function IsInRole (role As String) As Boolean
Parâmetros
- role
- String
O nome da função para a qual verificar a adesão.
Devoluções
true se o atual GenericPrincipal for membro da função especificada; caso contrário, false.
Implementações
Exemplos
O código seguinte mostra a utilização do IsInRole método. Este exemplo de código faz parte de um exemplo maior fornecido para a GenericPrincipal classe.
if ( genericPrincipal->IsInRole( L"NetworkUser" ) )
{
Console::WriteLine( L"User belongs to the NetworkUser role." );
}
if (genericPrincipal.IsInRole("NetworkUser"))
{
Console.WriteLine("User belongs to the NetworkUser role.");
}
If (genericPrincipal.IsInRole("NetworkUser")) Then
WriteLine("User belongs to the NetworkUser role.")
End If