PermissionSet.Intersect(PermissionSet) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立並傳回目前 PermissionSet 與指定 PermissionSet 交集的權限集。
public:
System::Security::PermissionSet ^ Intersect(System::Security::PermissionSet ^ other);
public:
virtual System::Security::PermissionSet ^ Intersect(System::Security::PermissionSet ^ other);
public System.Security.PermissionSet? Intersect (System.Security.PermissionSet? other);
public virtual System.Security.PermissionSet Intersect (System.Security.PermissionSet other);
public System.Security.PermissionSet Intersect (System.Security.PermissionSet other);
member this.Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
abstract member Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
override this.Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
Public Function Intersect (other As PermissionSet) As PermissionSet
Public Overridable Function Intersect (other As PermissionSet) As PermissionSet
參數
- other
- PermissionSet
要與目前 PermissionSet 產生交集的權限集。
傳回
新的權限集,代表目前 PermissionSet 和指定目標的交集。 如果交集是空的,這個物件就是 null
。
範例
下列程式代碼範例示範 如何使用 Intersect 方法。 此程式代碼範例是提供給 類別之較大範例的 PermissionSet 一部分。
// Display the intersection of two permission sets.
PermissionSet^ ps3 = ps2->Intersect( ps1 );
Console::WriteLine( "The intersection of the first permission set and the second permission set = {0}", ps3 );
// Display the intersection of two permission sets.
PermissionSet ps3 = ps2.Intersect(ps1);
Console.WriteLine("The intersection of the first permission set and "
+ "the second permission set = " + ps3.ToString());
' Display the intersection of two permission sets.
Dim ps3 As PermissionSet = ps2.Intersect(ps1)
Console.WriteLine("The intersection of the first permission set and " & "the second permission set = " & ps3.ToString())
備註
兩個許可權集合的交集是一個許可權集合,描述兩者共同描述的作業集。 具體來說,它代表最低許可權,讓通過這兩個許可權集合的任何要求也會通過其交集。
針對這兩個集合中存在的每種許可權類型,這些許可權的兩個實例會與許可權的 Intersect
方法交集;產生的許可權會包含在產生的 PermissionSet中。 只存在於兩個集合的其中一個許可權類型會從產生的集合中排除。