如何从 C# 应用程序调用用 VB 编写的函数

问题描述:

我有一个用 vb 编写的函数

I have a function written in vb

Public Function abc (ByVal x as Integer, ByVal y as String) As String 

End Function

我想在 C# 应用程序中单击按钮来调用此函数.

I want to call this function on click of a button in C# applcation.

  1. 添加对包含代码的程序集的引用.
  2. 创建一个包含你想要的方法(函数)的类的对象打电话
  3. 调用方法objectname.abc(3,"SomeSting");