<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.1.20120.5" />

CodeConnectAccess

public class CodeConnectAccess
Specifies the network resource access that is granted to code.
public static readonly string AnyScheme

Contains the string value that represents the scheme wildcard.

public static readonly int DefaultPort

Contains the value used to represent the default port.

public static readonly int OriginPort

Contains the value used to represent the port value in the URI where code originated.

public static readonly string OriginScheme

Contains the value used to represent the scheme in the URL where the code originated.

public int Port { get; }

Gets the port represented by the current instance.

public string Scheme { get; }

Gets the URI scheme represented by the current instance.

public CodeConnectAccess(string allowScheme, int allowPort)

Initializes a new instance of the CodeConnectAccess class.

public static CodeConnectAccess CreateAnySchemeAccess(int allowPort)

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

public static CodeConnectAccess CreateOriginSchemeAccess(int allowPort)

Returns a CodeConnectAccess instance that represents access to the specified port using the code's scheme of origin.