NetworkInformationPermission.IsUnrestricted 方法

定义

返回一个值,该值指示当前权限是否不受限制。Returns a value indicating whether the current permission is unrestricted.

public:
 virtual bool IsUnrestricted();
public bool IsUnrestricted ();
abstract member IsUnrestricted : unit -> bool
override this.IsUnrestricted : unit -> bool
override this.IsUnrestricted : unit -> bool
Public Function IsUnrestricted () As Boolean

返回

Boolean

如果当前权限不受限制,则为 true;否则为 falsetrue if the current permission is unrestricted; otherwise, false.

实现

示例

下面的示例创建一个权限对象并显示其状态。The following example creates a permission object and displays its state.

System::Net::NetworkInformation::NetworkInformationPermission^ unrestricted = gcnew System::Net::NetworkInformation::NetworkInformationPermission( System::Security::Permissions::PermissionState::Unrestricted );

Console::WriteLine( L"Is unrestricted? {0}", unrestricted->IsUnrestricted() );

System.Net.NetworkInformation.NetworkInformationPermission unrestricted =
    new System.Net.NetworkInformation.NetworkInformationPermission(
        System.Security.Permissions.PermissionState.Unrestricted);

Console.WriteLine("Is unrestricted? " + unrestricted.IsUnrestricted());
Dim unrestricted As New System.Net.NetworkInformation.NetworkInformationPermission( _
    System.Security.Permissions.PermissionState.Unrestricted)
Console.WriteLine("Is unrestricted? " + unrestricted.IsUnrestricted().ToString())

注解

使用构造函数创建一个无限制的权限 NetworkInformationPermissionAn unrestricted permission is created using the NetworkInformationPermission constructor.

适用于