PermissionSet.ContainsNonCodeAccessPermissions 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个值,它指示 PermissionSet 是否包含不派生自 CodeAccessPermission 的权限。
public:
bool ContainsNonCodeAccessPermissions();
public bool ContainsNonCodeAccessPermissions ();
member this.ContainsNonCodeAccessPermissions : unit -> bool
Public Function ContainsNonCodeAccessPermissions () As Boolean
返回
如果 PermissionSet 包含不派生自 CodeAccessPermission 的权限,则为 true
;否则为 false
。
示例
下面的代码示例演示了该方法的使用 ContainsNonCodeAccessPermissions 。 此代码示例是为 PermissionSet 类提供的一个更大示例的一部分。
// Display the result of a call to the ContainsNonCodeAccessPermissions method.
// Gets a value indicating whether the PermissionSet contains permissions
// that are not derived from CodeAccessPermission.
// Returns true if the PermissionSet contains permissions that are not
// derived from CodeAccessPermission; otherwise, false.
Console::WriteLine( "ContainsNonCodeAccessPermissions method returned {0}", ps1->ContainsNonCodeAccessPermissions() );
// Display the result of a call to the ContainsNonCodeAccessPermissions method.
// Gets a value indicating whether the PermissionSet contains permissions
// that are not derived from CodeAccessPermission.
// Returns true if the PermissionSet contains permissions that are not
// derived from CodeAccessPermission; otherwise, false.
Console.WriteLine("ContainsNonCodeAccessPermissions method returned " +
ps1.ContainsNonCodeAccessPermissions());
' Display the result of a call to the ContainsNonCodeAccessPermissions method.
' Gets a value indicating whether the PermissionSet contains permissions
' that are not derived from CodeAccessPermission.
' Returns true if the PermissionSet contains permissions that are not
' derived from CodeAccessPermission; otherwise, false.
Console.WriteLine("ContainsNonCodeAccessPermissions method returned " & ps1.ContainsNonCodeAccessPermissions())