Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GenericPrincipal::IsInRole Method (String^)

 

Determines whether the current GenericPrincipal belongs to the specified role.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual bool IsInRole(
	String^ role
) override

Parameters

role
Type: System::String^

The name of the role for which to check membership.

Return Value

Type: System::Boolean

true if the current GenericPrincipal is a member of the specified role; otherwise, false.

The following code shows the use of the IsInRole method. This code example is part of a larger example provided for the GenericPrincipal class.

if ( genericPrincipal->IsInRole( L"NetworkUser" ) )
{
   Console::WriteLine( L"User belongs to the NetworkUser role." );
}

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft