Tag: device

C#

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) { …

C#

Get USB information in C#

We will see how we can retrieve various information about usb devices in C#. We need the class ManagementObjectSearcher and Win32_DiskDrive class. To use this class we have to add a reference to System.Management namespace. and now.. the interesting part: 1 2 3 4 5 6 7 8 9 10 ManagementObjectSearcher theSearcher = new ManagementObjectSearcher("SELECT …