You are loading a new assembly into an application. You need to override the default evidence for the assembly.

You are loading a new assembly into an application. You need to override the default evidence
for the assembly. You require the common language runtime (CLR) to grant the assembly a
permission set, as if the assembly were loaded from the local intranet zone.
You need to build the evidence collection. Which code segment should you use?



A. Evidence^ evidence = gcnew
    Evidence(Assembly::GetExecutingAssembly()->Evidence);
B. Evidence^ evidence = gcnew Evidence();evidence->AddAssembly(gcnew    
    Zone(SecurityZone::Intranet));
C. Evidence^ evidence = gcnew Evidence();evidence->AddHost(gcnew    
    Zone(SecurityZone::Intranet));
D. Evidence^ evidence = gcnew Evidence(AppDomain::CurrentDomain->Evidence);


Answer: C 

No comments:

Post a Comment