/// <summary> /// Dumps each received packet to a pcap file /// </summary> private static void device_PcapOnPacketArrival(object sender, SharpPcap.CaptureEventArgs e) { ICaptureDevice device = (ICaptureDevice)sender; //if device has a dump file opened if (device.DumpOpened) { device.Dump(e.Packet); } _packetCount++; }