Reputation:
Is there a Windows Event or mechanism that I can use to know if an SD Card is mounted on a PC running Windows XP/ Vista /7 in C#?
Up to today I found a way to use WM Messages to know if a new Drive is connected and also a way with WQL and they work fine for CD / DVD and USB but none was able to detect if I inserted a SD Card into the PC. This seems to be different from USB Drives and I guess that is because the "Reader" Hardware is already attached to the PC.
But I can't believe that there is no way:(
A bit background to my Question:
I have to copy 800 SD Cards by Hand, that's a one Time thing, and I want to make a little application that starts the copyjob as soon as I insert a card so that you don't have to click any buttons.
Upvotes: 2
Views: 1730
Reputation: 63
IIRC, Windows 7 has autoplay disabled for all drives except CD/DVD/BD.
Were I you, this is what I would do:
Upvotes: 0
Reputation: 4532
It's not exactly what you are looking for, but maybe an alternative solution:
There's a guide how to register your app as an auto-play handler on codeproject. You could then check the box telling windows to always use this action and there you go.
Edit:
Another approach would be to use the DriveDetector class also introduced on codeproject. This class will automatically notify you about arrived or removed drives, but I'm not sure if this works for flash cards.
Upvotes: 2