namespace GenericTypeNS{
public class GenericType
......
}
}
...
Assembly asm = Assembly.LoadFrom(asmPath);
object o = asm.CreateInstance("GenericTypeNS.GenericType'1[[%TypeName%]]");
Replace %TypeName% to the specificed class name, for example if we want to create an GenericType
object o = asm.CreateInstance("GenericTypeNS.GenericType'1[[System.Int32,
mscorlib,Version=2.0.0.0,Culture=neutral,
PublicKeyToken=b77a5c561934e089]]");
沒有留言:
張貼留言