Assembly ass=Assembly.LoadFrom("ReflectionStudy.exe");
Type t = ass.GetType("ReflectionStudy.Form1");
object obj = Activator.CreateInstance(t);
多参数初始化
Assembly assembly = Assembly.LoadFrom("GUI.exe");
Type type = assembly.GetType("GUI.V4A_TP_DataExchange.UploadDataUnitClient_" + cmbUploadDataUnits.SelectedItem.ToString());
UploadDataUnitClient[] UploadDataUnitClientSingle=new UploadDataUnitClient[1];
Object[] objPara = new Object[] { _sqlConnection};
Object obj = Activator.CreateInstance(type,objPara);
UploadDataUnitClientSingle[0]= (UploadDataUnitClient)obj;
_DataExchangeBase.UploadDataUnitClientArray = UploadDataUnitClientSingle;
Type type = assembly.GetType("GUI.V4A_TP_DataExchange.UploadDataUnitClient_" + cmbUploadDataUnits.SelectedItem.ToString());
UploadDataUnitClient[] UploadDataUnitClientSingle=new UploadDataUnitClient[1];
Object[] objPara = new Object[] { _sqlConnection};
Object obj = Activator.CreateInstance(type,objPara);
UploadDataUnitClientSingle[0]= (UploadDataUnitClient)obj;
_DataExchangeBase.UploadDataUnitClientArray = UploadDataUnitClientSingle;