private void Start() { ICaptureDevice device = PacketDeviceSelector.AskForPacketDevice(); device.OnPacketArrival += new PacketArrivalEventHandler(PacketHandler); device.Open(DeviceMode.Promiscuous, 1000); device.StartCapture(); }
private void Start() { var device = PacketDeviceSelector.AskForPacketDevice(); // var device = new OfflinePacketDevice("dump.pcap"); // Your wireshark dump (IT MUST BE *.pcap) using (PacketCommunicator communicator = device.Open(65536, PacketDeviceOpenAttributes.Promiscuous, 1000)) { communicator.ReceivePackets(0, PacketHandler); } }