Bagikan melalui


WebPermission.Intersect(IPermission) Metode

Definisi

Mengembalikan persimpangan logis dari dua WebPermission instans.

public:
 override System::Security::IPermission ^ Intersect(System::Security::IPermission ^ target);
public override System.Security.IPermission Intersect (System.Security.IPermission target);
override this.Intersect : System.Security.IPermission -> System.Security.IPermission
Public Overrides Function Intersect (target As IPermission) As IPermission

Parameter

target
IPermission

WebPermission untuk membandingkan dengan instans saat ini.

Mengembalikan

WebPermission Baru yang mewakili persimpangan instans saat ini dan target parameter . Jika persimpangan kosong, metode mengembalikan null.

Pengecualian

target bukan null atau berjenis WebPermission

Contoh

Contoh berikut menunjukkan cara membuat instans menggunakan WebPermission persimpangan logis dari dua instans yang ada WebPermission .

// Create a third WebPermission instance via the logical intersection of the previous
// two WebPermission instances.
WebPermission^ myWebPermission3 = (WebPermission^)(myWebPermission1->Intersect( myWebPermission2 ));

Console::WriteLine( "\nAttributes and Values of  the WebPermission instance after the Intersect are:\n" );
Console::WriteLine( myWebPermission3->ToXml() );

// Create a third WebPermission instance via the logical intersection of the previous
// two WebPermission instances.
WebPermission myWebPermission3 =(WebPermission) myWebPermission1.Intersect(myWebPermission2);

Console.WriteLine("\nAttributes and Values of  the WebPermission instance after the Intersect are:\n");   
Console.WriteLine(myWebPermission3.ToXml().ToString());
   ' Create a third WebPermission instance via the logical intersection of the previous
   ' two WebPermission instances.
   Dim myWebPermission3 As WebPermission = CType(myWebPermission1.Intersect(myWebPermission2), WebPermission)
   
   Console.WriteLine(ControlChars.Cr + "Attributes and Values of  the WebPermission instance after the Intersect are:" + ControlChars.Cr)
   Console.WriteLine(myWebPermission3.ToXml().ToString())
End Sub

Keterangan

Intersect mengembalikan yang WebPermission berisi izin yang umum dalam instans target saat ini dan .

Metode ini mengambil Intersect alih dan diimplementasikan untuk mendukung IPermission antarmuka.

Berlaku untuk