NetworkInformationPermission.AddPermission(NetworkInformationAccess) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified value to this permission.
public:
void AddPermission(System::Net::NetworkInformation::NetworkInformationAccess access);
public void AddPermission (System.Net.NetworkInformation.NetworkInformationAccess access);
member this.AddPermission : System.Net.NetworkInformation.NetworkInformationAccess -> unit
Public Sub AddPermission (access As NetworkInformationAccess)
Parameters
- access
- NetworkInformationAccess
One of the NetworkInformationAccess values.
Examples
The following example creates an empty permission object and then adds to it.
System::Net::NetworkInformation::NetworkInformationPermission^ permission = gcnew System::Net::NetworkInformation::NetworkInformationPermission( System::Security::Permissions::PermissionState::None );
permission->AddPermission( System::Net::NetworkInformation::NetworkInformationAccess::Read );
Console::WriteLine( L"Access is {0}", permission->Access );
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);
Dim permission As New System.Net.NetworkInformation.NetworkInformationPermission( _
System.Security.Permissions.PermissionState.None)
permission.AddPermission(System.Net.NetworkInformation.NetworkInformationAccess.Read)
Console.WriteLine("Access is {0}", permission.Access)
Remarks
Use this method to modify access to network information by adding to the state of the current permission.
Applies to
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.