好友
阅读权限10
听众
最后登录1970-1-1
|
200吾爱币
调用的是有米的单窗口单ip dll,在易语言里面测试正常可以工作,c#里面可以调用,返回值也是true,但是没有效果 ,下面是c#代码
// DLL 导入定义
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern IntPtr YouMiIp_init ([MarshalAs (UnmanagedType.LPStr) string driverName, [MarshalAs (UnmanagedType.LPStr) string bindIp, [MarshalAs (UnmanagedType.LPStr) string loopbackIpv4, [MarshalAs (UnmanagedType.LPStr) string loopbackIpv6, bool compatibilityMode);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern bool YouMiIp_interceptMode (int interceptMode);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern int YouMiIp_addRule (int toHead, int protocol, int pid, int direction, int localPort, int remotePort, int ipFamily, string localIpAddress, string localIpMask, string remoteIpAddress, string remoteIpMask, int filteringFlag, string processName);
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern bool YouMiIp_addPidProxy (int pid, int proxyMode, [MarshalAs (UnmanagedType.LPStr) string proxyUrl, int targetFilter, [MarshalAs (UnmanagedType.LPStr) string targetFilterList, int dnsMode, [MarshalAs (UnmanagedType.LPStr) string dnsModeList, int speedLimitId);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi)
public static extern void YouMiIp_free ();
[DllImport ("D:\\XYDcapSDK2.dll")
public static extern long YouMiIp_getSendFlow (int pid);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern long YouMiIp_getRecvFlow (int pid);
[DllImport ("D:\\XYDcapSDK2.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)
public static extern int YouMiIp_getNumConnections (int pid);
public IntPtr Init (string driverName, string bindIp, string loopbackIpv4, string loopbackIpv6, bool compatibilityMode)
{
return YouMiIp_init (driverName, bindIp, loopbackIpv4, loopbackIpv6, compatibilityMode);
}
public bool AddPidProxy (int pid, int proxyMode, string proxyUrl, int targetFilter, string targetFilterList, int dnsMode, string dnsModeList, int speedLimitId)
{
return YouMiIp_addPidProxy (pid, proxyMode, proxyUrl, targetFilter, targetFilterList, dnsMode, dnsModeList, speedLimitId);
}
public void close ()
{
YouMiIp_free ();
} |
下面是e语言源码带核心挨揍云地址
https://wwm.lanzoue.com/iwacU1zksr4b |
|