GenericPrincipal.IsInRole(String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
現在の GenericPrincipal が指定したロールに属しているかどうかを判断します。
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
パラメーター
- role
- String
メンバーシップを確認するロールの名前。
返品
実装
例
次のコードは、 IsInRole メソッドの使用方法を示しています。 このコード例は、 GenericPrincipal クラスに提供されるより大きな例の一部です。
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