編集

次の方法で共有


SiteIdentityPermission Constructors

Definition

Initializes a new instance of the SiteIdentityPermission class.

Overloads

SiteIdentityPermission(PermissionState)

Initializes a new instance of the SiteIdentityPermission class with the specified PermissionState.

SiteIdentityPermission(String)

Initializes a new instance of the SiteIdentityPermission class to represent the specified site identity.

SiteIdentityPermission(PermissionState)

Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs

Initializes a new instance of the SiteIdentityPermission class with the specified PermissionState.

public:
 SiteIdentityPermission(System::Security::Permissions::PermissionState state);
public SiteIdentityPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.SiteIdentityPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.SiteIdentityPermission
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.

Remarks

The fully restricted state of SiteIdentityPermission matches no sites. This constructor is included for consistency with the design of other permissions, but is not useful in practice.

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

SiteIdentityPermission(String)

Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs
Source:
SiteIdentityPermission.cs

Initializes a new instance of the SiteIdentityPermission class to represent the specified site identity.

public:
 SiteIdentityPermission(System::String ^ site);
public SiteIdentityPermission (string site);
new System.Security.Permissions.SiteIdentityPermission : string -> System.Security.Permissions.SiteIdentityPermission
Public Sub New (site As String)

Parameters

site
String

The site name or wildcard expression.

Exceptions

The site parameter is not a valid string, or does not match a valid wildcard site name.

Remarks

Site identity is only defined for code from URLs with the protocols of HTTP, HTTPS, and FTP. A site is the string between the "//" after the protocol of a URL and the following "/", if present, for example, www.fourthcoffee.com in the URL http://www.fourthcoffee.com/process/grind.htm/. This excludes port numbers. If a given URL is http://www.fourthcoffee.com:8000/, the site is www.fourthcoffee.com, not www.fourthcoffee.com:8000.

Sites can be matched exactly, or by a wildcard ("*") prefix at the dot delimiter. For example, the site name string *.fourthcoffee.com matches fourthcoffee.com as well as www.fourthcoffee.com. Without a wildcard, the site name must be a precise match.

Applies to