NetworkInformationPermission.AddPermission Method (NetworkInformationAccess)

 

Adds the specified value to this permission.

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

public void AddPermission(
	NetworkInformationAccess access
)

Use this method to modify access to network information by adding to the state of the current permission.

The following example creates an empty permission object and then adds to it.

System.Net.NetworkInformation.NetworkInformationPermission permission = 
    new System.Net.NetworkInformation.NetworkInformationPermission(
        System.Security.Permissions.PermissionState.None);
permission.AddPermission(
        System.Net.NetworkInformation.NetworkInformationAccess.Read);
Console.WriteLine("Access is {0}", permission.Access);

.NET Framework
Available since 2.0
Return to top
Show: