void DynamicallyInvokeMembers(Assembly myAssembly)
{
Type classType = myAssembly.GetType(“Reflected”);
PropertyInfo myProperty
= classType.GetProperty(“MyProperty”);
MethodInfo propGet = myProperty.GetGetMethod();
object reflectedObject
= Activator.CreateInstance(classType);
propGet.Invoke(reflectedObject, null);
MethodInfo myMethod
= classType.GetMethod(“MyInstanceMethod”);
myMethod.Invoke(reflectedObject, null);
}
转载于:https://my.oschina.net/u/2296689/blog/545759