SmtpPermission.IsUnrestricted 方法

定义

返回一个值,该值指示当前权限是否不受限制。

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

返回

如果当前权限不受限制,则为 true;否则为 false

实现

示例

以下示例创建权限对象并显示其状态。

static SmtpPermission^ CreateUnrestrictedPermission()
{
    SmtpPermission^ allAccess = 
        gcnew SmtpPermission(PermissionState::Unrestricted);
    Console::WriteLine("Is unrestricted? {0}", 
        allAccess->IsUnrestricted());
    return allAccess;
}
public static SmtpPermission CreateUnrestrictedPermission()
{
    SmtpPermission allAccess = new
        SmtpPermission(System.Security.Permissions.PermissionState.Unrestricted);
    Console.WriteLine("Is unrestricted? {0}",
        allAccess.IsUnrestricted());
    return allAccess;
}

注解

不受限制的权限对权限实例控制的所有资源具有完全访问权限。

适用于