1.对于.net或者com型的组件,直接添加引用即可。

2.对于标准的dll文件,利用DLLImport这个函数即可,如果要使用函数的别名,那么应该加入EntryPoint。

示例:一般可以封装成一个类,然后在其他类中引用即可。

using System.Runtime.InteropServices;
public class MyWin32Wrapper
{
   [DllImport("User32.dll")]
   static public extern void Beep(int frequency,int duration);
}