C#调用VS2010编译的wpcap
1.windows VS2010对wpcap进行二次封装
具体见https://blog.csdn.net/weixin_42627035/article/details/90273852
wpcap封装好后还要添加 添加模块定义文件 .def
https://blog.csdn.net/qq385105501/article/details/82253725
2.C#调用封装的wpcap库,进行数据交互可以用结构体,如果数据多的话用指针
c++代码
extern "C" __declspec(dllexport) int __stdcall setModifyIp(BatchDeviceInfo &arg);
extern "C" __declspec(dllexport) int __stdcall refreshDeviceList(char *devResult);
C#代码
[DllImport(@"CreateDLL.dll", EntryPoint = "setModifyIp")]
extern static int setModifyIp(ref BatchDeviceInfo f);
[DllImport(@"CreateDLL.dll", EntryPoint = "refreshDeviceList")]
extern static int refreshDeviceList(StringBuilder str);