Bagikan melalui


NetworkInformationPermission.Access Properti

Definisi

Mendapatkan tingkat akses ke informasi jaringan yang dikontrol oleh izin ini.

public:
 property System::Net::NetworkInformation::NetworkInformationAccess Access { System::Net::NetworkInformation::NetworkInformationAccess get(); };
public System.Net.NetworkInformation.NetworkInformationAccess Access { get; }
member this.Access : System.Net.NetworkInformation.NetworkInformationAccess
Public ReadOnly Property Access As NetworkInformationAccess

Nilai Properti

Salah NetworkInformationAccess satu nilai.

Contoh

Contoh kode berikut membuat NetworkInformationPermission, menambahkan NetworkInformationAccess nilai ke dalamnya, dan menampilkan nilai properti ini.

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)

Keterangan

Yang NetworkInformationPermission dibuat dengan PermissionState.Unrestricted diberi Ping | Read akses. Yang NetworkInformationPermission dibuat dengan PermissionState.None diberi None akses.

Berlaku untuk