日期:2014-05-17  浏览次数:20992 次

VB转C#
VB的Friend在C#中叫什么?

------解决方案--------------------
C#没有friend

http://stackoverflow.com/questions/445490/what-is-the-equivalant-of-a-friend-keyword-in-c-sharp
------解决方案--------------------
C#中没有friend关键字了。应该是internal这个关键字对应。
------解决方案--------------------
引用:
Quote: 引用:

C#没有friend

http://stackoverflow.com/questions/445490/what-is-the-equivalant-of-a-friend-keyword-in-c-sharp

英文的,不懂。


自己找本字典看看。
------解决方案--------------------
http://msdn.microsoft.com/en-us/library/08w05ey2.aspx


看这句中的这几个词
Specifies that one or more declared programming elements are accessible only from within the assembly that contains their declaration.

和internal是一样的,一个assembly之内。
------解决方案--------------------
那VB中的Private是干嘛的呢?
------解决方案--------------------
就我个人感觉internal这个内部,应该不是和firend一样的,不过LZ上说的VB里的private用来做什么,那我确实无话反驳!