SemaphoreAcl.OpenExisting(String, SemaphoreRights) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
打开指定的命名信号灯(如果已存在),并应用所需的访问权限。
public:
static System::Threading::Semaphore ^ OpenExisting(System::String ^ name, System::Security::AccessControl::SemaphoreRights rights);
public static System.Threading.Semaphore OpenExisting(string name, System.Security.AccessControl.SemaphoreRights rights);
static member OpenExisting : string * System.Security.AccessControl.SemaphoreRights -> System.Threading.Semaphore
Public Shared Function OpenExisting (name As String, rights As SemaphoreRights) As Semaphore
参数
- name
- String
要打开的信号灯的名称。 如果前缀为“Global”,则表示计算机范围的信号灯。 如果前缀为“Local”,或没有前缀,则表示会话范围的信号灯。 前缀和名称都区分大小写。
- rights
- SemaphoreRights
要应用于返回信号灯的所需访问权限。
返回
现有的命名信号灯。
例外
name 是 null。
name 是空字符串。
命名信号灯不存在或无效。
命名信号灯存在,但用户没有使用它所需的安全访问权限。