UIPermission 构造函数

定义

初始化 UIPermission 类的新实例。Initializes a new instance of the UIPermission class.

重载

UIPermission(PermissionState)

初始化 UIPermission 类的新实例,该实例可根据指定具有完全受限制的访问权限或不受限制的访问权限。Initializes a new instance of the UIPermission class with either fully restricted or unrestricted access, as specified.

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 类的新实例。Initializes a new instance of the UIPermission class with the permissions for windows, and no access to the Clipboard.

UIPermission(UIPermissionWindow, UIPermissionClipboard)

用指定的窗口和剪贴板权限初始化 UIPermission 类的新实例。Initializes a new instance of the UIPermission class with the specified permissions for windows and the Clipboard.

UIPermission(PermissionState)

初始化 UIPermission 类的新实例,该实例可根据指定具有完全受限制的访问权限或不受限制的访问权限。Initializes a new instance of the UIPermission class with either fully restricted or unrestricted access, as specified.

public:
 UIPermission(System::Security::Permissions::PermissionState state);
public UIPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.UIPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.UIPermission
Public Sub New (state As PermissionState)

参数

state
PermissionState

枚举值之一。One of the enumeration values.

异常

state 参数不是有效的 PermissionStateThe state parameter is not a valid PermissionState.

示例

下面的代码示例演示如何使用UIPermission构造函数。The following code example shows the use of the UIPermission constructor. 此示例是为UIPermission类提供的更大示例的一部分。This example is part of a larger example provided for the UIPermission class.

UIPermission ^ uiPerm2 = gcnew UIPermission(PermissionState::None);
UIPermission uiPerm2 = new UIPermission(PermissionState.None);
Dim uiPerm2 As New UIPermission(PermissionState.None)

注解

此构造函数创建完全受限制(NoneUnrestricted或权限的形式。This constructor creates either the fully restricted (None) or the Unrestricted form of the permission.

UIPermission(UIPermissionClipboard)

在具有使用剪贴板的权限,但没有对窗口的访问权限的情况下,初始化 UIPermission 类的新实例。Initializes a new instance of the UIPermission class with the permissions for the Clipboard, and no access to windows.

public:
 UIPermission(System::Security::Permissions::UIPermissionClipboard clipboardFlag);
public UIPermission (System.Security.Permissions.UIPermissionClipboard clipboardFlag);
new System.Security.Permissions.UIPermission : System.Security.Permissions.UIPermissionClipboard -> System.Security.Permissions.UIPermission
Public Sub New (clipboardFlag As UIPermissionClipboard)

参数

clipboardFlag
UIPermissionClipboard

枚举值之一。One of the enumeration values.

异常

clipboardFlag 参数不是有效的 UIPermissionClipboard 值。The clipboardFlag parameter is not a valid UIPermissionClipboard value.

示例

下面的代码示例演示如何使用UIPermission.UIPermission(UIPermissionClipboard)构造函数。The following code example shows the use of the UIPermission.UIPermission(UIPermissionClipboard) constructor. 此示例是为UIPermission类提供的更大示例的一部分。This example is part of a larger example provided for the UIPermission class.

uiPerm1 = gcnew UIPermission(UIPermissionClipboard::AllClipboard);
uiPerm1 = new UIPermission(UIPermissionClipboard.AllClipboard);
uiPerm1 = New UIPermission(UIPermissionClipboard.AllClipboard)

注解

若要同时设置 "剪贴板" 和 "窗口" 权限,请使用两个均采用参数的构造函数。To set both the Clipboard and window permissions, use the constructor that takes parameters for both.

UIPermission(UIPermissionWindow)

在具有使用窗口的权限,但没有对剪贴板的访问权限的情况下,初始化 UIPermission 类的新实例。Initializes a new instance of the UIPermission class with the permissions for windows, and no access to the Clipboard.

public:
 UIPermission(System::Security::Permissions::UIPermissionWindow windowFlag);
public UIPermission (System.Security.Permissions.UIPermissionWindow windowFlag);
new System.Security.Permissions.UIPermission : System.Security.Permissions.UIPermissionWindow -> System.Security.Permissions.UIPermission
Public Sub New (windowFlag As UIPermissionWindow)

参数

windowFlag
UIPermissionWindow

枚举值之一。One of the enumeration values.

异常

windowFlag 参数不是有效的 UIPermissionWindow 值。The windowFlag parameter is not a valid UIPermissionWindow value.

示例

下面的代码示例演示如何使用UIPermission.UIPermission(UIPermissionWindow)构造函数。The following code example shows the use of the UIPermission.UIPermission(UIPermissionWindow) constructor. 此示例是为UIPermission类提供的更大示例的一部分。This example is part of a larger example provided for the UIPermission class.

UIPermission ^ uiPerm1 = gcnew UIPermission(UIPermissionWindow::SafeTopLevelWindows);
UIPermission uiPerm1 = new UIPermission(UIPermissionWindow.SafeTopLevelWindows);
Dim uiPerm1 As New UIPermission(UIPermissionWindow.SafeTopLevelWindows)

注解

若要同时设置 "剪贴板" 和 "窗口" 权限,请使用两个均采用参数的构造函数。To set both the Clipboard and window permissions, use the constructor that takes parameters for both.

UIPermission(UIPermissionWindow, UIPermissionClipboard)

用指定的窗口和剪贴板权限初始化 UIPermission 类的新实例。Initializes a new instance of the UIPermission class with the specified permissions for windows and the Clipboard.

public:
 UIPermission(System::Security::Permissions::UIPermissionWindow windowFlag, System::Security::Permissions::UIPermissionClipboard clipboardFlag);
public UIPermission (System.Security.Permissions.UIPermissionWindow windowFlag, System.Security.Permissions.UIPermissionClipboard clipboardFlag);
new System.Security.Permissions.UIPermission : System.Security.Permissions.UIPermissionWindow * System.Security.Permissions.UIPermissionClipboard -> System.Security.Permissions.UIPermission
Public Sub New (windowFlag As UIPermissionWindow, clipboardFlag As UIPermissionClipboard)

参数

windowFlag
UIPermissionWindow

枚举值之一。One of the enumeration values.

clipboardFlag
UIPermissionClipboard

枚举值之一。One of the enumeration values.

异常

windowFlag 参数不是有效的 UIPermissionWindow 值。The windowFlag parameter is not a valid UIPermissionWindow value.

-or- clipboardFlag 参数不是有效的 UIPermissionClipboard 值。The clipboardFlag parameter is not a valid UIPermissionClipboard value.

示例

下面的代码示例演示如何使用UIPermission.UIPermission(UIPermissionWindow, UIPermissionClipboard)构造函数。The following code example shows the use of the UIPermission.UIPermission(UIPermissionWindow, UIPermissionClipboard) constructor. 此示例是为UIPermission类提供的更大示例的一部分。This example is part of a larger example provided for the UIPermission class.

UIPermission ^ uiPerm1 = gcnew UIPermission(UIPermissionWindow::SafeTopLevelWindows,UIPermissionClipboard::OwnClipboard);
UIPermission uiPerm1 = new UIPermission(UIPermissionWindow.SafeTopLevelWindows, UIPermissionClipboard.OwnClipboard);
Dim uiPerm1 As New UIPermission(UIPermissionWindow.SafeTopLevelWindows, UIPermissionClipboard.OwnClipboard)

适用于