本文介绍了C#弹出USB笔式驱动器与弹出便携式硬盘驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在关注 CodeProject Tutorial 在C#中删除USB驱动器。我面临的问题是USB笔式驱动器成功弹出但不适用于便携式硬盘驱动器。代码如下:
I am following the CodeProject Tutorial to remove a USB drive in C#. the issue I am facing is the USB Pen Drive eject successfully but doesn't works on a portable hard drive. code is given below
int r = CM_Request_Device_Eject_NoUi(DevInstParent, IntPtr.Zero, null, 0, 0);
LogFile.Err("Eject Return value - " + r);
当强制USB笔式驱动器弹出整数时r返回0并且弹出命令成功,但当一个便携式驱动器被强制弹出时,它返回23(CR_REMOVE_VETOED)。如何解决这个问题?
When a USB pen drive is forced to eject the integer r returns 0 and eject command is successful, but when a portable drive is forced to eject, it returns 23(CR_REMOVE_VETOED). How to tackle this issue?
推荐答案
这篇关于C#弹出USB笔式驱动器与弹出便携式硬盘驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!