Internal in C #
Represents a modifier that can be accessed only in an assembly
Specific:
For example, you write a log DLL, any project as long as the reference to this DLL can realize the function of logging, the DLL file program is an assembly.
If the assembly that you log is so defined
namespaceLogerhelper {Internal classLoginfo { Public voidlog () {Console.WriteLine ("wirte log ...."); } } Public classWrite { Public voidWritein (stringcontent) {Loginfo obj=NewLoginfo (); Obj.log (); } }}
How to call:
When another project references this DLL
It can be accessed so
Logerhelper.write x = new Logerhelper.write ();
X.writein ("");
But you can't access this.
Logerhelper.loginfo x = new Logerhelper.loginfo ();
X.log ();
This is called, and can only be accessed in the Assembly
OK, that's it, every day with me, a minute!
Internal keywords in C #