惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
V
Vulnerabilities – Threatpost
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
月光博客
月光博客
T
Troy Hunt's Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
Know Your Adversary
Know Your Adversary
SecWiki News
SecWiki News
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threatpost
Forbes - Security
Forbes - Security
S
Schneier on Security
P
Proofpoint News Feed
T
Tor Project blog
Cyberwarzone
Cyberwarzone
The Hacker News
The Hacker News
Cloudbric
Cloudbric
S
Security @ Cisco Blogs
Webroot Blog
Webroot Blog
Attack and Defense Labs
Attack and Defense Labs
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
CERT Recently Published Vulnerability Notes
The Last Watchdog
The Last Watchdog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
SegmentFault 最新的问题
V
V2EX
量子位
B
Blog RSS Feed
宝玉的分享
宝玉的分享
T
The Blog of Author Tim Ferriss
罗磊的独立博客
J
Java Code Geeks

博客园 - 大坏蛋

struts 2.1配置 腾讯,你是怎么知道我机器上装了360的 程序.NET Framework版本升级,重签名,重链接,批量签名工具 .NET 平台优秀控件及源代码介绍(一) 灯神 终于轻松下来了 如何扮演另一个帐号(C#实现) .NET Remoting的新特性-IpcChannel(.NET Framework 2.0) 我的GMAIL开始使用 关于委派的返回值 .NET Remoting中的事件处理(.NET Framework 2.0) 关于MyIE2中博客园页面自动跳转的问题回答 Thread.Abort终止一个线程 今天统计了一下我们项目的代码 Friend Assembly 忘记交手机费,招商银行的自助缴费不错! 六一快到了,祝所有小朋友节日快乐 COM+连接池的问题 系统消息框居然是可以复制的
Friend Assemblies(.NET FrameWork 2.0新特性)
大坏蛋 · 2004-09-10 · via 博客园 - 大坏蛋

一个Assembly中所有的非公共类型,可以被它的【好友】Assembly访问。即如果AssemblyA中声明AssemblyB是它的好友Assembly,则AssemblyB可以像访问自身Assembly一样访问AssemblyA的私有类型。
将另一个Assembly声明成自己的Friend Assembly,需要使用一个InternalsVisibleToAttribute的特性。

[assembly:InternalsVisibleTo ("AssemblyB", PublicKeyToken="32ab4ba45e0a69a1")]

不过,声明Friend Assembly,代表允许AssemblyB访问自己的私有类型,但B不做逆向声明,A是不能访问B的私有类型的。跟现实生活一样。有的人你把他当朋友,什么秘密都告诉他,可人家没把你当朋友(开个玩笑,我身边没有)。