/// <summary> /// 根据_guid连接设备("eb8322c5-8b49-4feb-ae6e-c99b2b232045"),并获取读写句柄。 /// </summary> /// <param name="_guid">Format:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</param> /// <returns>返回连接成功与否,True:连接成功。False:失败。</returns> public bool ConnectDevice(string _guid) { bool result = false; try { deviceGUID = new Guid(_guid); } catch { return false; } myDevice = new InitDeviceByGUID(deviceGUID); result = myDevice.DeviceInitializer(); return result; }
/// <summary> /// 连接默认GUID设备("eb8322c5-8b49-4feb-ae6e-c99b2b232045"),并获取读写句柄。 /// </summary> /// <returns>返回连接成功与否,True:连接成功。False:失败。</returns> public bool ConnectDevice() { bool result = false; //deviceGUID = DMY2_GUID; deviceGUID = GUID_CLASS_BF_USB_BULKADI; myDevice = new InitDeviceByGUID(deviceGUID); result = myDevice.DeviceInitializer(); return result; }