在类中添加引用
using System.Runtime.InteropServices;
在程序中写
//关闭连接 [DllImport("opapi2.dll", EntryPoint = "op2_close", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Winapi)] public static extern void op2_close(IntPtr op);
所写的方法名称与函数入口点应一样,即 op2_close =op2_close