public static Hashtable InvokeSrc_Once(string searchPath, string srcCodePath, string classFullName, string methodName, Type[] paraTypes, object[] paras) { Hashtable hashtable = null; AppDomain domain = null; string text = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Guid.NewGuid().ToString().Replace("-", ""); try { domain = MainUtil.CreateShadowAppDomain(text, searchPath); RemoteUtil remoteUtil = MainUtil.CreateRemoteUtil(domain); hashtable = remoteUtil.InvokeSrc(srcCodePath, classFullName, methodName, paraTypes, paras); } catch (Exception ex) { hashtable = new Hashtable(); hashtable["Success"] = false; hashtable["Data"] = ex.ToString(); } finally { AppDomain.Unload(domain); try { Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "DynamicCache/" + text, true); } catch (Exception) { } } return(hashtable); }
public static Hashtable InvokeSrc_Direct(string srcCodePath, string typename, string methodName, Type[] paraTypes, object[] paras) { Hashtable hashtable = null; try { RemoteUtil remoteUtil = new RemoteUtil(); hashtable = remoteUtil.InvokeSrc(srcCodePath, typename, methodName, paraTypes, paras); } catch (Exception ex) { hashtable = new Hashtable(); hashtable["Success"] = false; hashtable["Data"] = ex.ToString(); } return(hashtable); }