Working with USB devices in .NET

前端 未结 12 1222
暖寄归人
暖寄归人 2020-11-27 10:56

Using .Net (C#), how can you work with USB devices?

How can you detect USB events (connections/disconnections) and how do you communicate with devices (read/write).

12条回答
  •  我在风中等你
    2020-11-27 11:23

    I tried several of these suggestions with no luck. I ended up writing a working solution using Java and the hid4java library. As a console app I can shell out to it from C# using Process.Start(), passing parameters as well as reading responses. This provides basic HID I/O but without connect/disconnect events. For that I'd need to rewrite it to run as a daemon/service and use named pipes or some other server/client transport. For now, it's enough to get the job done since the hi4java library "just works".

提交回复
热议问题