如何使类成员受到保护并成为内部成员?
可能的重复:
如何使受保护和内部?
即它是内部成员,并且可以只能从该类的派生类访问。
Possible Duplicate:
How to make protected AND internal?
i.e. it is an internal member, and can only be accessed from a class deriving from this class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
所有这些答案都是相反的:受保护的内部可用于派生类或同一(或InternalsVisibleTo)程序集中的其他对象。您想要的东西是不可能的,正如 Eric Lippert 指出的那样,它并不是真正有用,或者至少是您不应该很快期望的东西: http://blogs.msdn。 com/b/ericlippert/archive/2008/04/24/why-can-ti-access-a-protected-member-from-a-driven-class-part- Three.aspx
All these answers are backwards: protected internal is available to derived classes OR other objects in the same (or InternalsVisibleTo) assembly. What you want is not possible and as Eric Lippert points out, not really useful, or at the least, something you shouldn't expect anytime soon: http://blogs.msdn.com/b/ericlippert/archive/2008/04/24/why-can-t-i-access-a-protected-member-from-a-derived-class-part-three.aspx
使用受保护的内部访问修饰符 - http://msdn.microsoft.com/en-us /library/ms173121.aspx
using protected internal Access Modifier - http://msdn.microsoft.com/en-us/library/ms173121.aspx
有一个受保护的内部访问标识符。你可以用它。
there is a protected internal access identifier. You can use that.
只需使用两个访问说明符即可..
Just use both access specifiers..