GacMembershipCondition.Check(Evidence) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates whether the specified evidence satisfies the membership condition.
public:
virtual bool Check(System::Security::Policy::Evidence ^ evidence);
public bool Check (System.Security.Policy.Evidence evidence);
abstract member Check : System.Security.Policy.Evidence -> bool
override this.Check : System.Security.Policy.Evidence -> bool
Public Function Check (evidence As Evidence) As Boolean
Parameters
Returns
true
if the specified evidence satisfies the membership condition; otherwise, false
.
Implements
Examples
The following code example shows the use of the Check method. This example is part of a larger example provided for the GacMembershipCondition class.
GacMembershipCondition ^ Gac1 = gcnew GacMembershipCondition;
GacInstalled ^ myGac = gcnew GacInstalled;
try
{
array<Object^>^hostEvidence = {myGac};
array<Object^>^assemblyEvidence = {};
Evidence^ myEvidence =
gcnew Evidence(hostEvidence,assemblyEvidence);
bool retCode = Gac1->Check(myEvidence);
Console::WriteLine("Result of Check = {0}\n", retCode);
}
catch (Exception^ e)
{
Console::WriteLine("Check failed : {0}{1}", Gac1, e);
return false;
}
GacMembershipCondition Gac1 = new GacMembershipCondition();
GacInstalled myGac = new GacInstalled();
try
{
Object [] hostEvidence = {myGac};
Object [] assemblyEvidence = {};
Evidence myEvidence = new Evidence(hostEvidence,assemblyEvidence);
bool retCode = Gac1.Check(myEvidence);
Console.WriteLine("Result of Check = " + retCode.ToString() + "\n");
}
catch (Exception e)
{
Console.WriteLine("Check failed : " + Gac1.ToString() + e);
return false;
}
Dim Gac1 As New GacMembershipCondition
Dim myGac As New GacInstalled
Try
Dim hostEvidence() As Object = {myGac}
Dim assemblyEvidence() As Object
Dim myEvidence As New Evidence(hostEvidence, assemblyEvidence)
Dim retCode As Boolean = Gac1.Check(myEvidence)
Console.WriteLine(("Result of Check = " & retCode.ToString() _
& ControlChars.Lf))
Catch e As Exception
Console.WriteLine(("Check failed : " & Gac1.ToString() & _
e.ToString()))
Return False
End Try
Remarks
This membership condition tests GacInstalled evidence.
Applies to
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.