Click here to Skip to main content
16,022,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I understand that all member variables in a module declared as Public, are exposed as 'Shared Members' in the assembly.
Since we know that public variables should be accessed by any project that is referencing them, how come they are shared and able to be accessed only within the project that they are declared?

Best Regards
Posted

use internal modifier to your variable so that it can only be accessible to within assembly.

Take a look at MSDN Article

http://msdn.microsoft.com/en-us/library/7c5ka91b(VS.80).aspx[^]
 
Share this answer
 
ok, but the question is why does member variables declared with the Public access modifier does NOT provide true public access through being able to access it from an other project instead they behave as Friend.
Or am I wrong?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900