How to detect a USB drive has been plugged in?

It is easy to check for removable devices. However, there’s no guarantee that it is a USB device: var drives = DriveInfo.GetDrives() .Where(drive => drive.IsReady && drive.DriveType == DriveType.Removable); This will return a list of all removable devices that are currently accessible. More information: The DriveInfo class (msdn documentation) The DriveType enumeration (msdn documentation)

Get the serial number of USB storage devices in .Net Core 2.1

This Class performs a series of queries on the WMI Win32_DiskDrive class and its associators: Win32_DiskDriveToDiskPartition and CIM_LogicalDiskBasedOnPartition, to retrieve informations on the active USB Drives on a System (local or remote). It might seem redundant (probably because it is), since you just asked for the USB Drives Serial Number. But, you never know what … Read more