CreateAnySchemeAccess Method

CodeConnectAccess.CreateAnySchemeAccess Method

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

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

public static CodeConnectAccess CreateAnySchemeAccess(
	int allowPort


Type: System.Int32

The port represented by the returned instance.

Return Value

Type: System.Security.Policy.CodeConnectAccess
A CodeConnectAccess instance for the specified port.


allowPort is less than 0.


allowPort is greater than 65,535.

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

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.

    public static CodeConnectAccess CreateAnySchemeOriginPortAccess()
    return CodeConnectAccess.CreateAnySchemeAccess(CodeConnectAccess.OriginPort);

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

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

© 2015 Microsoft