Namespace CLib
{
Public interface ITest
{
Void upload EST ();
}
Public class Test: ITest
{
Public void synchronized EST ()
{
System. Console. WriteLine ("Hello Reflection ");
}
}
}
Class Program
{
Static void Main (string [] args)
{
Assembly ass = System. Reflection. Assembly. LoadFrom ("CLib. dll ");
Type type = ass. GetType ("CLib. Test ");
Type type1 = System. Activator. CreateInstanceFrom ("CLib. dll", "CLib. Test"). GetType ();
Type type2 = System. Activator. CreateInstanceFrom ("CLib. dll", "CLib. Test"). Unwrap (). GetType ();
Console. WriteLine (type. ToString ());
Console. WriteLine (type1.ToString ());
Console. WriteLine (type2.ToString ());
Console. WriteLine ("============================= ");
CLib. ITest test = (CLib. ITest) System. Activator. CreateInstance ("CLib", "CLib. Test"). Unwrap ();
Test. Sort EST ();
Console. WriteLine ("============================= ");
Console. ReadLine ();
}
}