Επεξεργασία

Κοινή χρήση μέσω


CodeConnectAccess.CreateAnySchemeAccess(Int32) Method

Definition

Returns a CodeConnectAccess instance that represents access to the specified port using any scheme.

public:
 static System::Security::Policy::CodeConnectAccess ^ CreateAnySchemeAccess(int allowPort);
public static System.Security.Policy.CodeConnectAccess CreateAnySchemeAccess (int allowPort);
static member CreateAnySchemeAccess : int -> System.Security.Policy.CodeConnectAccess
Public Shared Function CreateAnySchemeAccess (allowPort As Integer) As CodeConnectAccess

Parameters

allowPort
Int32

The port represented by the returned instance.

Returns

A CodeConnectAccess instance for the specified port.

Exceptions

allowPort is less than 0.

-or-

allowPort is greater than 65,535.

Examples

The following code example demonstrates calling this method. For an example that demonstrates using CodeConnectAccess objects to create a code group and adding the code group to a policy level, see the CodeConnectAccess class overview.


static CodeConnectAccess^ CreateAnySchemeOriginPortAccess()
{
    return CodeConnectAccess::CreateAnySchemeAccess
        (CodeConnectAccess::OriginPort);
}
    public static CodeConnectAccess CreateAnySchemeOriginPortAccess()
{
    return CodeConnectAccess.CreateAnySchemeAccess(CodeConnectAccess.OriginPort);
}

Remarks

The CodeConnectAccess instance returned by this method uses the scheme wildcard value AnyScheme ("*") to represent the scheme.

Applies to