First of all, it is very good that I approach my problem incorrectly, and in this case I gladly accept the alternatives.
I am trying to determine which drive was created after connecting the USB device to the computer.
Here is a simplified workflow:
List<string> listRemovableDrivesBefore = GetRemovableDriveList();
...
...
do
{
...
} while
List<string> listRemovableDrivesAfter = GetRemovableDriveList();
???
GetRemovableDriveListreturns a list of strings of removable drives. My idea was to get a list of removable drives before the device is connected, and another list after it is connected, and that by deleting the contents of the first list from the second, I would leave the drives that were just connected (usually only one).
But I cannot find an easy way to “subtract” one list from another. Anyone can offer a solution or even a better way to achieve what I'm trying to do.
: .NET framework 2.0, LINQ .
!