Obtain devices list with SharpPcap

SharpPcap is a cross-platform packet capture framework for the .NET environment, based on the famous pcap / WinPcap libraries. It provides an API for capturing, injecting, analyzing and building packets using any .NET language such as C# and VB.NET.
 

CaptureDeviceList cdevices = CaptureDeviceList.Instance;
if (cdevices.Count >= 1)
{
	foreach (ICaptureDevice dev in cdevices)
	{
		Console.WriteLine(dev.Name + " " + dev.Description);
	}
}
%d bloggers like this: