基本上是三步曲:

1)添加一个using:usingSystem.Runtime.InteropServices.

2)在需要使用的类中导入dll:[dllimport ("yourdll")]

3)添加函数说明

private static extern  类型 yourfuction(arg)