다음을 통해 공유


GacMembershipCondition.Check(Evidence) 메서드

정의

지정된 증명 정보가 멤버 자격 조건에 맞는지 여부를 나타냅니다.

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

매개 변수

evidence
Evidence

테스트할 Evidence입니다.

반환

지정된 증명 정보가 멤버 자격 조건에 맞으면 true이고, 그렇지 않으면 false입니다.

구현

예제

다음 코드 예제에서는 사용 하는 메서드입니다 Check . 이 예제는에 대해 제공 된 큰 예제의 일부는 GacMembershipCondition 클래스입니다.

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

설명

이 멤버 자격 조건은 증거를 테스트합니다 GacInstalled .

적용 대상