SecurityPermissionAttribute.ControlThread 属性

获取或设置一个值,该值指示是否声明了操作线程的权限。

**命名空间:**System.Security.Permissions
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Property ControlThread As Boolean
用法
Dim instance As SecurityPermissionAttribute
Dim value As Boolean

value = instance.ControlThread

instance.ControlThread = value
public bool ControlThread { get; set; }
public:
property bool ControlThread {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_ControlThread ()

/** @property */
public void set_ControlThread (boolean value)
public function get ControlThread () : boolean

public function set ControlThread (value : boolean)

属性值

如果声明了操作线程的权限,则为 true;否则为 false

备注

有关更多信息,请参见 Thread

示例

下面的代码示例演示如何使用 ControlThread 属性拒绝操作线程的能力。有关完整的代码示例,请参见 SecurityPermissionAttribute 类。

' Set the Assertion,UnmanagedCode, ControlAppDomain, ControlDomainPolicy, ontrolEvidence, 
' ControlPolicy, ControlPrincipal, ControlThread, Execution, Flags, Infrastructure, 
' RemotingConfiguration, SerializationFormatter, and SkipVerification properties.
<SecurityPermissionAttribute(SecurityAction.Deny, Assertion:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlAppDomain:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlDomainPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlEvidence:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPrincipal:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlThread:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Execution:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Flags:=SecurityPermissionFlag.NoFlags), _
SecurityPermissionAttribute(SecurityAction.Deny, Infrastructure:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, RemotingConfiguration:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SerializationFormatter:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SkipVerification:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, UnmanagedCode:=True)> _
Public Shared Sub DenySecurityPermissions()
    // Set the ControlThread property.
[SecurityPermissionAttribute(SecurityAction.Deny, ControlThread = true)]
// Set the ControlThread property.
[SecurityPermissionAttribute(SecurityAction::Deny,ControlThread=true)]
// Set the ControlThread property.
/** @attribute SecurityPermissionAttribute(SecurityAction.Deny, 
    ControlThread = true)
 */

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

SecurityPermissionAttribute 类
SecurityPermissionAttribute 成员
System.Security.Permissions 命名空间