Freigeben über


PermissionSet.ContainsNonCodeAccessPermissions-Methode

Ruft einen Wert ab, der angibt, ob das PermissionSet Berechtigungen enthält, die nicht von CodeAccessPermission abgeleitet sind.

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

Syntax

'Declaration
Public Function ContainsNonCodeAccessPermissions As Boolean
'Usage
Dim instance As PermissionSet
Dim returnValue As Boolean

returnValue = instance.ContainsNonCodeAccessPermissions
public bool ContainsNonCodeAccessPermissions ()
public:
bool ContainsNonCodeAccessPermissions ()
public boolean ContainsNonCodeAccessPermissions ()
public function ContainsNonCodeAccessPermissions () : boolean

Rückgabewert

true, wenn das PermissionSet Berechtigungen enthält, die nicht von CodeAccessPermission abgeleitet sind, andernfalls false.

Beispiel

Im folgenden Codebeispiel wird die Verwendung der ContainsNonCodeAccessPermissions-Methode veranschaulicht. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die PermissionSet-Klasse.

' 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());
// 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 "
        + System.Convert.ToString(
        ps1.ContainsNonCodeAccessPermissions())));

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

PermissionSet-Klasse
PermissionSet-Member
System.Security-Namespace