Home > Net >  Consult a c # class declaration of related issues
Consult a c # class declaration of related issues

Time:10-11

I met a wonderful work, specific,

A class is as follows:

 

The class Child
{
Private int the age;

Private string name;

Private Mydll test;

Public void PrintChild ()
{
Console. WriteLine (" hello ");
}

}



One statement:

 private Mydll test; 


Is this "Mydll" type variables from a DLL in external references types,

Business logic is

After the program is running, the user may load the external DLLS, also could not load the DLL, he understood as an extension, I also don't know whether the user loads, and the business cannot force users to load, so the question comes,

If the user to load the DLL, then the
 private Mydll test; 
can perform normal

If the user didn't load the DLL, so the
 private Mydll test; 
complains,

But I can't afford to write
 private Mydll test; 
the, one thousand user load,

So the question is, if according to the user whether to load the DLL to the variable type dynamic statement?

Thank you very much!

CodePudding user response:

The building Lord, this is why direct statement for the object type, the runtime use reflection to the assignment,

CodePudding user response:

Your so-called "load" of the code posted didn't know how to write, you should
  •  Tags:  
  • C#
  • Related