163.You are developing a class library. Portions of your code need to access system environment variables. You
need to force a runtime SecurityException only when callers that are higher in the call stack do not have the
necessary permissions. Which call method should you use?
A. set.Demand();
B. set.Assert();
C. set.PermitOnly();
D. set.Deny();
求解
正确答案应该是哪个?
need to force a runtime SecurityException only when callers that are higher in the call stack do not have the
necessary permissions. Which call method should you use?
A. set.Demand();
B. set.Assert();
C. set.PermitOnly();
D. set.Deny();
求解
正确答案应该是哪个?
Assert 即使堆栈中的高级调用方未被授予访问当前权限对象所标识资源的权限,调用代码仍能访问该资源...
PermitOnly 即使代码已被授予访问其他资源的权限,也只能访问此权限对象所指定的资源...
Deny 即使调用方已被授予访问当前权限对象所指定资源的权限,调用方访问该资源的能力仍被拒绝...