简体   繁体   English

.NET中框架代码中的CodeAccessPermission

[英]CodeAccessPermission in framework code in .Net

If you use reflector to, for example, look at the implementation of the OnMouseEnter method of ButtonBase, it calls IntSecurity.AllWindows.Assert before showing a ToolTip control. 例如,如果使用反射器查看ButtonBase的OnMouseEnter方法的实现,它将在显示ToolTip控件之前调用IntSecurity.AllWindows.Assert。

Why? 为什么?

Calling Assert instructs the runtime to bypass particular security checks. 调用Assert指示运行时绕过特定的安全检查。 This increases performance and allows underprivileged code to call methods with CAS permission requirements. 这样可以提高性能,并允许特权代码调用具有CAS权限要求的方法。

You can find more information on MSDN here . 您可以在此处找到有关MSDN的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM