SharpPcap c#抓包實現時時獲取網卡信息
SharpPcap tutorial: a step by step guide to using SharpPcap
The text of this tutorial is taken directly from WinPcap's official tutorial but is modified to show the C# use of the SharpPcap library. All examples can be downloaded together with SharpPcap source code from SharpPcap 's homepage. The WinPcap library must be installed before attempting to run any of these examples, so please download and install the latest version from WinPcap's download page.
SharpPcap was written and tested using .NET v1.1 and Windows 2000/XP. I have no idea about other .NET and Windows versions. If you do try it, please report your results.
The following topics are covered in this tutorial:
Obtaining the device list
Obtaining advanced information about installed devices
Opening an adapter and capturing packets
Capturing packets without the event handler
Filtering the traffic
Interpreting the packets
Handling offline dump files
Sending Packets
Gathering Statistics on the network traffic
1. Obtaining the device list
In the hit CBS crime show Person of Interest, which debuted in 2011,
the two heroes—one a former Central Intelligence Agency agent and
the other a billionaire technology genius—work together using the
ubiquitous surveillance system in New York City to try to stop violent
crime. It’s referred to by some as a science fiction cop show. But the
use of advanced technology for crime analysis in almost every major
police department in the United States may surpass what’s depicted
on TV crime dramas such as Person of Interest. Real-time crime cen-
ters (RTCCs) are a vital aspect of intelligent policing. Crime analysis
is no longer the stuff of science fiction. It’s real.