SecurityCallContext.CurrentCall プロパティ
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文セキュリティ呼び出しコンテキストを説明する SecurityCallContext オブジェクト。
解説
使用例このメソッドを使用して、メソッド呼び出しのセキュリティ コンテキストを説明する SecurityCallContext オブジェクトを取得する方法のコード例を次に示します。
' Set the employee's salary. Only managers can do this. Public Sub SetSalary(ByVal ammount As Double) If SecurityCallContext.CurrentCall.IsCallerInRole("Manager") Then salary = ammount Else Throw New UnauthorizedAccessException() End If End Sub 'SetSalary
// Set the employee's salary. Only managers can do this. public void SetSalary (double ammount) { if (SecurityCallContext.CurrentCall.IsCallerInRole("Manager")) { salary = ammount; } else { throw new UnauthorizedAccessException(); } }
.NET Framework のセキュリティ
プラットフォームWindows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- SecurityCallContext.CurrentCall プロパティのページへのリンク