コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            // Create the USB reference device object (passing VID and PID)
            usbController = new usbDevice(0x04D8, 0x0045);

            // Add a listener for usb events
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);

            // Perform an initial search for the target device
            usbController.findTargetDevice();
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            dispatcherTimer.Tick += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            // Create the USB reference device object (passing VID and PID)
            usbController = new usbDevice(0x04D8, 0x0045);

            // Add a listener for usb events
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);

            // Perform an initial search for the target device
            usbController.findTargetDevice();
        }