一个简单的调用DLL里面的方法,首先引用DLL进项目,然后根据下面方法进行调用。

Dim objType As System.Type = Nothing

Dim objAssembly As System.Reflection.Assembly                

Dim objMethod As System.Reflection.MethodInfo = Nothing                

Dim objReturn As Object = Nothing                

Dim objArgs As Object() = Nothing

 

objAssembly = System.Reflection.Assembly.UnsafeLoadFrom("DLL路径")                

objType = objAssembly.GetType("命名空间")                

objMethod = objType.GetMethod("方法名称")

objArgs = New Object() {"传递的参数,必须与传入方法的参数一致"}

objReturn = objMethod.Invoke(Nothing, objArgs) 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-01-10
猜你喜欢
  • 2021-10-30
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-07-05
相关资源
相似解决方案