从读卡器C#弹出存储卡 [英] Eject Memory card from Card Reader C#

查看:454
本文介绍了从读卡器C#弹出存储卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义开发的USB读卡器。我使用下面的代码进行交互和iterrate对设备:

I have a custom developed USB card reader. I am using the following code to interact and iterrate over the device:

http://www.codeproject.com/KB/system/usbeject.aspx

上面的代码提供了一个'使用以下行退出的方法:

The code above provides an 'eject' method using the following line:

Native.CM_Request_Device_Eject_NoUi(device.InstanceHandle, IntPtr.Zero, null, 0, 0);



然而,这弹出方法卸载简单地弹出介质卡整个驱动器来代替。

However this 'eject' method unmounts the entire drive instead of simply ejecting the media card.

为什么这是一个问题,因为我想弹出媒体卡,再放入另一个。然而,当整个阅读器弹出我必须拔下/重新插入该设备为它显示回来了。

Why this is a problem is because I want to 'eject' the media card, then put in a different one. However when the whole reader is ejected i have to unplug/replug the device for it to show back up.

在Windows资源管理器,当我用鼠标右键单击弹出它工作在我想象,它安全删除存储卡但不读卡器。

In windows explorer when I right click 'eject' it operates as I am imagining, where it safely removes the memory card but not the card reader.

我该如何去用C#impelmenting这种不同类型的弹出的?

How can I go about impelmenting this different type of eject in c#?

谢谢,
萧蔷

推荐答案

我心中已经相同的任务。 :)

I'v the same task. :)

您需要使用弹出可移动媒体。
请参阅C ++在这里样本:如何弹出可移动媒体

You need use ejecting removable media. See c++ sample here: How To Ejecting Removable Media

这篇关于从读卡器C#弹出存储卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆