語言

SemaphoreAcl.OpenExisting(String, SemaphoreRights) 方法

定義

若已存在,開啟指定的命名旗式,並套用所需的存取權限。

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 是空字串。

命名的信號量不存在或無效。

路徑未被找到。

-或-

發生 Win32 錯誤。

命名的信號量存在,但使用者沒有使用所需的安全權限。

適用於