UIPermission UIPermission UIPermission UIPermission Class

定義

控制與使用者介面和剪貼簿相關的使用權限。Controls the permissions related to user interfaces and the Clipboard. 這個類別無法被繼承。This class cannot be inherited.

public ref class UIPermission sealed : System::Security::CodeAccessPermission, System::Security::Permissions::IUnrestrictedPermission
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class UIPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission
type UIPermission = class
    inherit CodeAccessPermission
    interface IUnrestrictedPermission
Public NotInheritable Class UIPermission
Inherits CodeAccessPermission
Implements IUnrestrictedPermission
繼承
屬性
實作

備註

在 windows 中的繪圖和使用者輸入的事件都是使用者介面。Drawing and user input events in windows are user interfaces.

若要使用 windows 權限可以是下列其中之一: 無限制,限制為SafeTopLevelWindows,則只SafeSubWindows,或不繪製視窗或使用者輸入允許的事件存取。The permission to use windows can be one of the following: unrestricted, limited to SafeTopLevelWindows, only SafeSubWindows, or no window drawing or user input event access allowed. SafeTopLevelWindowsSafeSubWindows標題和大小,以避免可能的詐騙可能有害的程式碼中的限制。SafeTopLevelWindows and SafeSubWindows are restricted in title and size to prevent possible spoofing by potentially harmful code.

使用剪貼簿的權限可以是下列其中之一: 無限制,僅限寫入,或允許任何剪貼簿存取。The permission to use the Clipboard can be one of the following: unrestricted, write-only, or no Clipboard access allowed. 貼上的限制會防止可能有害的應用程式,從取得資料,從剪貼簿,而不需要使用者同意,同時仍然允許剪下、 複製和貼上作業時由使用者透過鍵盤命令。The paste limitation prevents potentially harmful applications from taking data from the Clipboard without the user's consent, while still allowing the cut, copy, and paste operations when initiated by the user through keyboard commands.

建構函式

UIPermission(PermissionState) UIPermission(PermissionState) UIPermission(PermissionState) UIPermission(PermissionState)

依指定使用完全限制或不限制的存取,初始化 UIPermission 類別的新執行個體。Initializes a new instance of the UIPermission class with either fully restricted or unrestricted access, as specified.

UIPermission(UIPermissionClipboard) UIPermission(UIPermissionClipboard) UIPermission(UIPermissionClipboard) UIPermission(UIPermissionClipboard)

使用剪貼簿使用權限和禁止視窗存取,初始化 UIPermission 類別的新執行個體。Initializes a new instance of the UIPermission class with the permissions for the Clipboard, and no access to windows.

UIPermission(UIPermissionWindow) UIPermission(UIPermissionWindow) UIPermission(UIPermissionWindow) UIPermission(UIPermissionWindow)

使用視窗使用權限和禁止剪貼簿存取,初始化 UIPermission 類別的新執行個體。Initializes a new instance of the UIPermission class with the permissions for windows, and no access to the Clipboard.

UIPermission(UIPermissionWindow, UIPermissionClipboard) UIPermission(UIPermissionWindow, UIPermissionClipboard) UIPermission(UIPermissionWindow, UIPermissionClipboard) UIPermission(UIPermissionWindow, UIPermissionClipboard)

使用指定的視窗和剪貼簿使用權限,初始化 UIPermission 類別的新執行個體。Initializes a new instance of the UIPermission class with the specified permissions for windows and the Clipboard.

屬性

Clipboard Clipboard Clipboard Clipboard

取得或設定權限所代表的剪貼簿存取。Gets or sets the Clipboard access represented by the permission.

Window Window Window Window

取得或設定由使用權限表示的視窗存取。Gets or sets the window access represented by the permission.

方法

Assert() Assert() Assert() Assert()

宣告即使堆疊中較高層的呼叫端未獲得資源存取權限,呼叫程式碼仍可透過呼叫這個方法的程式碼要求權限,來存取受保護的資源。Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. 使用 Assert() 可能會造成安全性問題。Using Assert() can create security issues.

(Inherited from CodeAccessPermission)
Copy() Copy() Copy() Copy()

建立並傳回目前權限的相同複本。Creates and returns an identical copy of the current permission.

Demand() Demand() Demand() Demand()

如果呼叫堆疊中所有較高層的呼叫端尚未授與目前執行個體 (Instance) 所指定的使用權限,請於執行階段強制執行 SecurityExceptionForces a SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

(Inherited from CodeAccessPermission)
Deny() Deny() Deny() Deny()

防止呼叫堆疊中較高層的呼叫端,使用呼叫這個方法的程式碼來存取目前執行個體所指定的資源。Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

(Inherited from CodeAccessPermission)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的 CodeAccessPermission 物件是否等於目前的 CodeAccessPermissionDetermines whether the specified CodeAccessPermission object is equal to the current CodeAccessPermission.

(Inherited from CodeAccessPermission)
FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement)

使用 XML 編碼方式重建具有指定狀態的使用權限。Reconstructs a permission with a specified state from an XML encoding.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

取得 CodeAccessPermission 物件的雜湊碼,其適合用於雜湊表這類的雜湊演算法和資料結構。Gets a hash code for the CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table.

(Inherited from CodeAccessPermission)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
Intersect(IPermission) Intersect(IPermission) Intersect(IPermission) Intersect(IPermission)

建立並傳回目前使用權限和指定之使用權限交集的使用權限。Creates and returns a permission that is the intersection of the current permission and the specified permission.

IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission)

判斷目前使用權限是否為指定之使用權限的子集。Determines whether the current permission is a subset of the specified permission.

IsUnrestricted() IsUnrestricted() IsUnrestricted() IsUnrestricted()

傳回數值,表示目前使用權限是否不受限制。Returns a value indicating whether the current permission is unrestricted.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
PermitOnly() PermitOnly() PermitOnly() PermitOnly()

防止呼叫堆疊中較高層的呼叫端,使用呼叫這個方法的程式碼來存取除了目前執行個體所指定資源之外的所有資源。Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance.

(Inherited from CodeAccessPermission)
ToString() ToString() ToString() ToString()

建立並傳回目前使用權限物件的字串表示。Creates and returns a string representation of the current permission object.

(Inherited from CodeAccessPermission)
ToXml() ToXml() ToXml() ToXml()

建立使用權限的 XML 編碼方式,和其目前狀態。Creates an XML encoding of the permission and its current state.

Union(IPermission) Union(IPermission) Union(IPermission) Union(IPermission)

建立該使用權限和指定使用權限聯集的使用權限。Creates a permission that is the union of the permission and the specified permission.

明確介面實作

IPermission.Demand() IPermission.Demand() IPermission.Demand() IPermission.Demand() Inherited from CodeAccessPermission
IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() Inherited from CodeAccessPermission
IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() Inherited from CodeAccessPermission
IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() Inherited from CodeAccessPermission
IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() Inherited from CodeAccessPermission

適用於

另請參閱