C# 不引用dll文件,调用dll文件里面的方法

//这里放在需要加载文件的类
  Assembly assembly  = Assembly.LoadFrom("xxxx.dll");//加载的dll
   Type type = assembly.GetType("xxxx.K3CloudApi");//获取类型
 object client = Activator.CreateInstance(type);
MethodInfo method = type.GetMethod("方法名称");
   List paramList = new List();//根据顺序添加方法入参
                paramList.Add(formId);
                paramList.Add(strJson);
             object result= method.Invoke(client, paramList.ToArray());

你可能感兴趣的:(c#,c++,windows)