简体   繁体   English

使用 C# 检测任何 USB 设备活动

[英]Detect any USB device activity using C#

How to detect usb activity using C#?如何使用 C# 检测 USB 活动? I want to use it to trigger a function.我想用它来触发一个功能。 In my case the device was detected as USB composite device .在我的情况下,该设备被检测为USB 复合设备

It all depends on what you mean by writing "usb activity".这完全取决于您编写“usb 活动”的含义。 Technically speaking, there is always USB activity between a connected USB device and the USB host.从技术上讲,连接的 USB 设备和 USB 主机之间始终存在 USB 活动。 USB is a protocol that is making heavy use of polling, with the USB host continuously polling connected USB devices with a frequency between 125 Hz and 1000 Hz. USB 是一种大量使用轮询的协议,USB 主机以 125 Hz 和 1000 Hz 之间的频率连续轮询连接的 USB 设备。 In other words, there would be no need attempting to detect USB activity because there is always USB activity between the USB host (computer) and connected USB devices.换言之,无需尝试检测 USB 活动,因为 USB 主机(计算机)和连接的 USB 设备之间始终存在 USB 活动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM