ZoneIdentityPermission Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the ZoneIdentityPermission class.
Overloads
ZoneIdentityPermission(PermissionState) |
Initializes a new instance of the ZoneIdentityPermission class with the specified PermissionState. |
ZoneIdentityPermission(SecurityZone) |
Initializes a new instance of the ZoneIdentityPermission class to represent the specified zone identity. |
ZoneIdentityPermission(PermissionState)
- Source:
- ZoneIdentityPermission.cs
- Source:
- ZoneIdentityPermission.cs
Initializes a new instance of the ZoneIdentityPermission class with the specified PermissionState.
public:
ZoneIdentityPermission(System::Security::Permissions::PermissionState state);
public ZoneIdentityPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.ZoneIdentityPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.ZoneIdentityPermission
Public Sub New (state As PermissionState)
Parameters
- state
- PermissionState
One of the PermissionState values.
Exceptions
The state
parameter is not a valid value of PermissionState.
Examples
The following example shows the use of the ZoneIdentityPermission.ZoneIdentityPermission(PermissionState) constructor.
ZoneIdentityPermission zoneIdPerm2 = new ZoneIdentityPermission(PermissionState.None);
Dim zoneIdPerm2 As New ZoneIdentityPermission(PermissionState.None)
Remarks
Creates either a fully restricted (None
) or Unrestricted
permission.
Note
In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. Starting with the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in 2.0 and later versions, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface. That is, a demand for an identity always succeeds, regardless of the identity of the assembly, if the assembly has been granted full trust.
In the .NET Framework versions 1.0 and 1.1, demands on the identity permissions are effective, even when the calling assembly is fully trusted. That is, although the calling assembly has full trust, a demand for an identity permission fails if the assembly does not meet the demanded criteria. Starting with the .NET Framework version 2.0, demands for identity permissions are ineffective if the calling assembly has full trust. This assures consistency for all permissions, eliminating the treatment of identity permissions as a special case.
Applies to
ZoneIdentityPermission(SecurityZone)
- Source:
- ZoneIdentityPermission.cs
- Source:
- ZoneIdentityPermission.cs
Initializes a new instance of the ZoneIdentityPermission class to represent the specified zone identity.
public:
ZoneIdentityPermission(System::Security::SecurityZone zone);
public ZoneIdentityPermission (System.Security.SecurityZone zone);
new System.Security.Permissions.ZoneIdentityPermission : System.Security.SecurityZone -> System.Security.Permissions.ZoneIdentityPermission
Public Sub New (zone As SecurityZone)
Parameters
- zone
- SecurityZone
The zone identifier.
Examples
The following example shows the use of the ZoneIdentityPermission.ZoneIdentityPermission(SecurityZone) constructor.
ZoneIdentityPermission zoneIdPerm1 = new ZoneIdentityPermission(SecurityZone.Intranet);
Dim zoneIdPerm1 As New ZoneIdentityPermission(SecurityZone.Intranet)