文件名称:USBDetect
- 所属分类:
- 驱动编程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2013-01-22
- 文件大小:
- 1023kb
- 下载次数:
- 0次
- 提 供 者:
- 秦**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
此代码是遍历pc上usb设备。
包含控制器 hub port 设配id 等信息
usb其实和串口是一样的,其端口也是固定的(如果你不接扩展hub)。
有时一台电脑接多个相同的usb设备,如果接连个摄像头(前后各一个),我们如果区分打开的是哪一个呢?
1、先把usb设备先遍历出来,得到usb信息(设备串等)。
2、通过打开usb设备时返回信息(这个很重要 //usb#vid_1d27&pid_0600#5&10ef021e&0&5#{c3b5f022-5a42-1980-1909-ea72095601b1})。
3、遍历注册表得到usb设备信息(#define USB_REGPATH "SYSTEM\\CurrentControlSet\\Enum\\USB\\" )。
4、通过第1条的设备串、第2条打开设备返回信息、注册表。就可以确定usb设备(控制器->hub->端口)
-This code is to traverse the PC USB device.
Includes a controller hub port with ID and other information
USB actually and serial port is the same, the port is fixed (if you don t pick up the extension hub).
Sometimes a computer connected to a plurality of the same USB device, if have a camera (before and after each one), if we distinguish open is which one?
1, the first USB device first traversal, get the USB information (such as equipment series).
2, through the information returned when opening the USB device (this is very important for //usb#vid_1d27&pid_0600#5&10ef021e&0&5#{c3b5f022-5a42-1980-1909-ea72095601b1}).
3, traversing registry USB device information (USB_REGPATH "#define SYSTEM\\CurrentControlSet\\Enum\\USB\\").
4, through the equipment first series, second open the device returns information, registry.You can determine the USB (controller->hub-> port)
包含控制器 hub port 设配id 等信息
usb其实和串口是一样的,其端口也是固定的(如果你不接扩展hub)。
有时一台电脑接多个相同的usb设备,如果接连个摄像头(前后各一个),我们如果区分打开的是哪一个呢?
1、先把usb设备先遍历出来,得到usb信息(设备串等)。
2、通过打开usb设备时返回信息(这个很重要 //usb#vid_1d27&pid_0600#5&10ef021e&0&5#{c3b5f022-5a42-1980-1909-ea72095601b1})。
3、遍历注册表得到usb设备信息(#define USB_REGPATH "SYSTEM\\CurrentControlSet\\Enum\\USB\\" )。
4、通过第1条的设备串、第2条打开设备返回信息、注册表。就可以确定usb设备(控制器->hub->端口)
-This code is to traverse the PC USB device.
Includes a controller hub port with ID and other information
USB actually and serial port is the same, the port is fixed (if you don t pick up the extension hub).
Sometimes a computer connected to a plurality of the same USB device, if have a camera (before and after each one), if we distinguish open is which one?
1, the first USB device first traversal, get the USB information (such as equipment series).
2, through the information returned when opening the USB device (this is very important for //usb#vid_1d27&pid_0600#5&10ef021e&0&5#{c3b5f022-5a42-1980-1909-ea72095601b1}).
3, traversing registry USB device information (USB_REGPATH "#define SYSTEM\\CurrentControlSet\\Enum\\USB\\").
4, through the equipment first series, second open the device returns information, registry.You can determine the USB (controller->hub-> port)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
USBDetect\bin\Test.exe
.........\...\USBDetect.dll
.........\Test\ReadMe.txt
.........\....\res\Test.ico
.........\....\...\Test.rc2
.........\....\resource.h
.........\....\stdafx.cpp
.........\....\stdafx.h
.........\....\targetver.h
.........\....\Test.aps
.........\....\Test.cpp
.........\....\Test.h
.........\....\Test.rc
.........\....\Test.vcproj
.........\....\Test.vcproj.PC-201008261742.Administrator.user
.........\....\TestDlg.cpp
.........\....\TestDlg.h
.........\USBDetect\cfg.h
.........\.........\cfgmgr32.h
.........\.........\cfgmgr32.lib
.........\.........\COMCTL32.LIB
.........\.........\debug.c
.........\.........\devioctl.h
.........\.........\devnode.c
.........\.........\dispaud.c
.........\.........\display.c
.........\.........\dllmain.cpp
.........\.........\enum.c
.........\.........\hid.lib
.........\.........\ReadMe.txt
.........\.........\resource.h
.........\.........\setupapi.lib
.........\.........\stdafx.cpp
.........\.........\stdafx.h
.........\.........\targetver.h
.........\.........\usb100.h
.........\.........\usbdesc.h
.........\.........\USBDetect.cpp
.........\.........\USBDetect.def
.........\.........\USBDetect.h
.........\.........\USBDetect.vcproj
.........\.........\USBDetect.vcproj.PC-201008261742.Administrator.user
.........\.........\usbioctl.h
.........\.........\usbview.c
.........\.........\usbview.h
.........\.........\vndrlist.h
.........\.........\winuser.h
.........\USBDetect.sln
.........\USBDetect.suo
.........\界面.JPG
.........\说明.txt
.........\Test\res
.........\bin
.........\Test
.........\USBDetect
USBDetect