当我向计算机插入设备时,计算机的设备管理器是可以看到这个设备,然后我想登录此设备,于是我写下了如下的代码,
但是提示CancelIoFailed LibUsbDotNet.Main.ErrorCode
项目中我使用了LibUsbDotNet库
result = LibUsbDotNet.Main.ErrorCode.CancelIoFailed
int num; byte[] buffer = new byte[0x40]; string str = ""; UsbEndpointReader mEpReader; byte nums = byte.Parse("1"); mEpReader = this.mUsbDevice.OpenEndpointReader((ReadEndpointID)((byte)(nums | 0x80))); var result = mEpReader.Read(buffer, 0x3e8, out num); if (result == ErrorCode.None) { str = Encoding.UTF8.GetString(buffer, 0, num); } return str;