跪求C# RegisterDeviceNotification DBT_DEVICEQUERYREMOVE 代码
想用C#实现,在U盘和移动硬盘弹出的时候,代码检测到 DBT_DEVICEQUERYREMOVE 消息,进行自己程序的一些处理。现在自己已经用 RegisterDeviceNotification 注册了,但程序还是检测不到DBT_DEVICEQUERYREMOVE 消息,急!跪求高手、大神、大牛、大虾解决!! C# USB --------------------编程问答-------------------- 发错地方了吧? --------------------编程问答-------------------- C的吧。MSDN有C的例子 http://msdn.microsoft.com/en-us/library/windows/desktop/aa3632061:注册方法不对吧 注册参照 http://blog.csdn.net/Sephoenix/article/details/5442064 --------------------编程问答-------------------- 谢谢两位的回复,问题我已解决! --------------------编程问答-------------------- 【探讨网站的盈利模式】网站靠什么盈利?比如传统的广告收入,电商(B2C、B2B、C2C)。还有其他盈利模式没,求补充! --------------------编程问答-------------------- 以下代码中,当try块内出现异常时,程序for循环的后续循环应该是会继续运行的吧?
//In some cases, the original CAB file to be extracted may contain the CAB files. So we need to extract the included CAB files.
string[] cabfiles = Directory.GetFiles(destPath, "*.cab", SearchOption.AllDirectories);
foreach (string cab in cabfiles)
{
try
{
ExtractCabDirectly(cab, destPath);
}
catch (Exception ex)
{
string errMsg = String.Format(CultureInfo.InvariantCulture, "ExtractCab: ExtractCabDirectly failed (includedCabFilePath = {0}, destPath = {1}).", cab, destPath);
Log.WriteEvent("PostEndProcess", 30000, EventLogEntryType.Error, EventCategory.Operational, errMsg, ex);
}
}
补充:.NET技术 , C#