CodeConnectAccess.CreateAnySchemeAccess(Int32) Method

Definition

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

C#
public static System.Security.Policy.CodeConnectAccess CreateAnySchemeAccess(int allowPort);

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.

C#
    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

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10