共用方式為


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;
}

備註

不受限制的許可權具有許可權實例所控制之所有資源的完整存取權。

適用於