111,126
社区成员
发帖
与我相关
我的任务
分享
[DllImport("AutoFindDevice.dll")]
public static extern int Initial();
[DllImport("AutoFindDevice.dll")]
public static extern void Search();
[DllImport("AutoFindDevice.dll")]
public static extern long GetDeviceFromCallBack(fGetDeviceByCallBack eventGetDeviceByCallBack);
public delegate void fGetDeviceByCallBack(NEWDHCP_INFO pDeviceInfo);
private event fGetDeviceByCallBack eventGetDeviceByCallBack;
private List<NEWDHCP_INFO> listd = new List<NEWDHCP_INFO>();
protected void Page_Load(object sender, EventArgs e)
{
eventGetDeviceByCallBack += new fGetDeviceByCallBack(GetInfo);
}
void GetInfo(NEWDHCP_INFO di)
{
listd.Add(di);
}
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NEWDHCP_INFO
{
/// <summary>
/// MAC地址
/// </summary>
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 20)]
public string strhostmac;
/// <summary>
}