public static object Reflection_Result(string Method, string DllName, string ClassName, object[] ParametersList)
{
object result;
try
{
DllName = DllName.Replace(".dll", "");
string dll = Path.GetFileName(DllName);
Assembly assembly = Assembly.LoadFrom(DllName + ".dll");
object obj1 = assembly.CreateInstance(dll + "." + ClassName);
Type type1 = obj1.GetType();
result = type1.GetMethod(Method).Invoke(obj1, ParametersList);
}
catch (Exception ex)
{
ErrorLogs.SaveError(ex, "COMMON_UTILITY");
throw ex;
}
return result;
}
No comments:
Post a Comment