内部:访问仅限于当前程序集. /p> Internal: Access is limited to the current assembly.据我所知,这些定义对我来说含义完全相同.To my understanding, these definitions mean quite the same to me.然后分别在VB.NET中进行编码时,使用 Friend 关键字指定仅在声明了该类或属性的程序集中才能访问该类或属性.在C#中相同,我使用 internal 关键字指定相同的内容.Then, respectively, when I'm coding in VB.NET, I use the Friend keyword to specify that a class or a property shall be accessible only within the assembly where it is declared. The same in C#, I use the internal keyword to specify the same. 从这个角度看我是在做错什么事吗?Am I doing something or anything wrong from this perspective?我没有得到哪些改进?请问某人请说明与朋友和内部人不是直接对等的方式或方式吗?Might someone please explain how or in what Friend and internal are not direct equivalences?在此先感谢您的回答!推荐答案我说过,没有直接等价于 C ++ 朋友"概念的人.这与VB.NET Friend概念不同,实际上等同于C#中的internal.I've said there's no direct equivalent of the C++ "friend" concept. That's not the same as the VB.NET Friend concept, which is indeed equivalent to internal in C#.上下文很重要-不要假设相同的词在所有语言中都具有完全相同的含义……静态"是一个典型的例子:)Context is important - don't assume that the same word means exactly the same thing in all languages... "static" is a classic example :) 这篇关于C#内部VS VBNET朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 20:03