zoukankan      html  css  js  c++  java
  • 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) 

  • 相关阅读:
    OutputCache详解
    C#数值类型的转换
    C#变量类型转换
    C#和.net
    数组
    mvc
    C#部分基础知识
    项目开发-->高级功能汇总
    项目开发-->基础功能汇总
    C#基础篇
  • 原文地址:https://www.cnblogs.com/rockchen/p/4045520.html
Copyright © 2011-2022 走看看