PermissionSet.Intersect(PermissionSet) 方法

定義

建立並傳回目前 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 System.Security.PermissionSet? Intersect (System.Security.PermissionSet? other);
public virtual 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

新的權限集,代表目前 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 中。 只有兩個集合之一中存在的許可權類型會從產生的集合中排除。

適用於