SocketPermission.AddPermission Method (NetworkAccess, TransportType, String, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Adds a permission to the set of permissions for a transport address.

Namespace:   System.Net
Assembly:  System (in System.dll)

member AddPermission : 
        access:NetworkAccess *
        transport:TransportType *
        hostName:string *
        portNumber:int -> unit

Parameters

access
Type: System.Net.NetworkAccess

One of the NetworkAccess values.

transport
Type: System.Net.TransportType

One of the TransportType values.

hostName
Type: System.String

The host name for the transport address.

portNumber
Type: System.Int32

The port number for the transport address.

Exception Condition
ArgumentNullException

hostName is null.

The hostName can be a DNS name, an IP address, or a specified IP subnet, such as 192.168.1.*.

The following example uses the AddPermission method to add connection permissions to the specified host.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: