Tag: call

从DLL调用函数?

我是C#的新手,我正在努力学习使用DLL。 我正在尝试将我的对象包装在DLL中,然后在我的程序中使用它。 public class Foo // its in the DLL { public int ID; public void Bar() { SomeMethodInMyProgram(); } } 所以我尝试将其打包到DLL但我不能,因为编译器不知道SomeMethodInMyProgram()是什么。 我想用它像: class Program // my program, using DLL { static void Main(string[] args) { Foo test = new Foo(); test.Bar(); } }