• VB调用Dll里面的方法


    一个简单的调用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) 

  • 相关阅读:
    2333
    STL string
    后缀自动机的应用
    省选一轮
    等价类计数问题(Polya定理和burnside引理)
    Prufer序列与树的计数(坑)
    分治算法
    生成函数
    莫队算法
    Xamarin 技术解析
  • 原文地址:https://www.cnblogs.com/rockchen/p/4045520.html
Copyright © 2020-2023  润新知