用Sharppcap处理数据遇到的问题,求大家帮忙!

f_dawei 2012-03-30 10:19:15
private void button2_Click(object sender, EventArgs e)
{
LivePcapDeviceList devices = LivePcapDeviceList.Instance;
device = devices[2];

System.Threading.Thread backgroundThread = null;
int readTimeoutMilliseconds = 1000;
device.Open(DeviceMode.Promiscuous, readTimeoutMilliseconds);

device.Filter = "udp";
device.Mode = CaptureMode.Packets;
device.OnPacketArrival += new PacketArrivalEventHandler(device_OnPacketArrival);
device.StartCapture();
}

public static void device_OnPacketArrival(object sender, CaptureEventArgs e)
{
//怎样把处理结果在listbox中显示出来?
}


device_OnpacketArrival是static的,怎样把ListBox,还有一些控件上的到的信息传到函数里去?
...全文
87 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧