I think through the c # to write a program to monitor the USB port, so long as has the U disk or external disk inserted, then get the port number, do you have to understand the great god give directions, the best is a simple example, thank you very much
CodePudding user response:
C # for mobile hard disk information, popup with insert event monitoring of mobile devices
CodePudding user response:
refer to 1st floor blow tornado destroyed parking lot response: c # for mobile hard disk information, listening to the mobile devices pop-up and insert events Thank you, I also saw, but this seems to be not achieve what I want this feature, you can also give directions please CodePudding user response:
If it is a desktop application, you need to form the system message interception WM_DEVICE_CHANGE, then determine which devices are connected to the system, Protected override void WndProc (ref Message m) { Int WM_DEVICE_CHANGE=0 x219 //here only handle WM_DEVICE_CHANGE message If (m.M sg!=WM_DEVICE_CHANGE) { Base. WndProc (ref m); return; } //write your processing logic below... } CodePudding user response:
reference datafansbj reply: 3/f if it is a desktop application, you need to form the system message interception WM_DEVICE_CHANGE, then determine which devices are connected to the system, Protected override void WndProc (ref Message m) { Int WM_DEVICE_CHANGE=0 x219 //here only handle WM_DEVICE_CHANGE message If (m.M sg!=WM_DEVICE_CHANGE) { Base. WndProc (ref m); return; } //write your processing logic below... } Thank you, this is to monitor hardware devices have change, but how to know is which a device inserted into the USB port CodePudding user response:
What with libusb32 or cyusb library, you see, CodePudding user response:
refer to the second floor Aspirant_Happy response: Quote: refer to 1st floor blow tornado destroyed parking lot response: c # for mobile hard disk information, listening to the mobile devices pop-up and insert events Thank you, I also saw this, but this seems to be not achieve what I want this feature, you can help me with it, please Are you want to get to turn the USB serial port that equipment serial number? CodePudding user response:
refer to 6th floor blow tornado destroyed parking lot response: Quote: refer to the second floor Aspirant_Happy response: Quote: refer to 1st floor blow tornado destroyed parking lot response: c # for mobile hard disk information, listening to the mobile devices pop-up and insert events Thank you, I also saw this, but this seems to be not achieve what I want this feature, you can help me with it, please Are you want to get to turn the USB serial port that equipment serial number? No, is inserted into the usb device corresponding port number CodePudding user response:
refer to 7th floor Aspirant_Happy response: Quote: refer to 6th floor blow tornado destroyed parking lot response: Quote: reference Aspirant_Happy reply 2 floor: Quote: refer to 1st floor blow tornado destroyed parking lot response: c # for mobile hard disk information, listening to the mobile devices pop-up and insert events Thank you, I also saw this, but this seems to be not achieve what I want this feature, you can help me with it, please Are you want to get to turn the USB serial port that equipment serial number? Not, is inserted into the usb device corresponding port Do you know how to achieve it, I asked some people, they said using Win32 API, but I don't know how to do CodePudding user response:
You plugged into the USB port will not have a name, it just is a serial bus, USB device information, you can get the most is if you want to get to the USB serial number of the serial port of simulation is possible