发射达人请看——类构造函数的一个参数是类类型的,如何反射?
需要被反射的类是这样写的(片段)
namespace Cj.Bm.Forms
{
public partial class BM_Edit : BaseForm
{
......
public BM_Edit(string BM, BMSP Father)
{
Initialize();
_bm = BM;
father = Father;
this.Text = "编码添加";
......
}
......
}
}
object formFather = Activator.CreateInstance(Type.GetType("Cj.Bm.Forms.BMSP"));
Form formObj = (Form)Activator.CreateInstance(Type.GetType("Cj.Bm.Forms.BM_Edit"), new object[] { "001", formFather });
formObj.ShowDialog();