private ModelLicence GetModelLicense() { //取得当前方法名 //System.Reflection.MethodBase mb = System.Reflection.MethodBase.GetCurrentMethod(); //父方法 System.Diagnostics.StackTrace ss = new System.Diagnostics.StackTrace(true); System.Reflection.MethodBase mb = ss.GetFrame(1).GetMethod(); ModelLicence ML = RH.SoftLicense[mb.Name]; return ML; }