public Striker2API.Usb usbToys; // Striker II object private void run() { // create a new instance usbToys = new Striker2API.Usb(); // init the Striker II, pass it the windows handle usbToys.Init(Process.GetCurrentProcess().MainWindowHandle); bool connected = usbToys.isUSBConnected(); if (!connected) { Console.WriteLine("No device connected."); } HttpListener listener = HttpListener.Create(System.Net.IPAddress.Any, 8089); listener.RequestReceived += OnRequest; listener.Start(5); Console.WriteLine("Active on port 8089"); Thread.Sleep(9000000); }
private void run() { // create a new instance usbToys = new Striker2API.Usb(); // init the Striker II, pass it the windows handle usbToys.Init(Process.GetCurrentProcess().MainWindowHandle); bool connected = usbToys.isUSBConnected(); if (!connected) { Console.WriteLine("No device connected."); } HttpListener listener = HttpListener.Create(System.Net.IPAddress.Any, 8089); listener.RequestReceived += OnRequest; listener.Start(5); Console.WriteLine("Active on port 8089"); Thread.Sleep(9000000); }