I need to emulate insertion and removal of SD cards to write tests. What is the best way/tool to implement it开发者_运维知识库 in .NET?
From this page:
How can my application reset, disable, or restart a USB device?
The DevCon example in the WDK is a command-line utility that shows how to enable, disable, restart, update, remove and query devices using the SetupAPI and CfgMgr32 API functions.
I'm pretty sure this will cause insertion/removal events provided that a card is physically inserted.
精彩评论