usb 设备遍历

上传者: yizhenweifeng | 上传时间: 2020-01-03 11:43:49 | 文件大小: 1023KB | 文件类型: rar
此代码是遍历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->端口) read by jerry

文件下载

资源详情

[{"title":"( 51 个子文件 1023KB ) usb 设备遍历","children":[{"title":"USBDetect","children":[{"title":"USBDetect.suo <span style='color:#111;'> 59.50KB </span>","children":null,"spread":false},{"title":"界面.JPG <span style='color:#111;'> 51.24KB </span>","children":null,"spread":false},{"title":"Test","children":[{"title":"resource.h <span style='color:#111;'> 768B </span>","children":null,"spread":false},{"title":"Test.vcproj.PC-201008261742.Administrator.user <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"Test.rc <span style='color:#111;'> 5.06KB </span>","children":null,"spread":false},{"title":"Test.vcproj <span style='color:#111;'> 5.40KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 2.75KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"Test.rc2 <span style='color:#111;'> 360B </span>","children":null,"spread":false},{"title":"Test.ico <span style='color:#111;'> 66.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"Test.cpp <span style='color:#111;'> 1.59KB </span>","children":null,"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 137B </span>","children":null,"spread":false},{"title":"Test.h <span style='color:#111;'> 433B </span>","children":null,"spread":false},{"title":"Test.aps <span style='color:#111;'> 102.39KB </span>","children":null,"spread":false},{"title":"TestDlg.h <span style='color:#111;'> 638B </span>","children":null,"spread":false},{"title":"TestDlg.cpp <span style='color:#111;'> 3.66KB </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 1.01KB </span>","children":null,"spread":false}],"spread":false},{"title":"说明.txt <span style='color:#111;'> 624B </span>","children":null,"spread":false},{"title":"USBDetect.sln <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Test.exe <span style='color:#111;'> 1.65MB </span>","children":null,"spread":false},{"title":"USBDetect.dll <span style='color:#111;'> 58.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"USBDetect","children":[{"title":"usb100.h <span style='color:#111;'> 7.45KB </span>","children":null,"spread":false},{"title":"resource.h <span style='color:#111;'> 978B </span>","children":null,"spread":false},{"title":"devnode.c <span style='color:#111;'> 3.97KB </span>","children":null,"spread":false},{"title":"USBDetect.cpp <span style='color:#111;'> 53.74KB </span>","children":null,"spread":false},{"title":"USBDetect.h <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"cfgmgr32.lib <span style='color:#111;'> 51.67KB </span>","children":null,"spread":false},{"title":"devioctl.h <span style='color:#111;'> 3.90KB </span>","children":null,"spread":false},{"title":"USBDetect.def <span style='color:#111;'> 74B </span>","children":null,"spread":false},{"title":"usbdesc.h <span style='color:#111;'> 9.04KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 419B </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 1.27KB </span>","children":null,"spread":false},{"title":"cfg.h <span style='color:#111;'> 4.57KB </span>","children":null,"spread":false},{"title":"dispaud.c <span style='color:#111;'> 32.57KB </span>","children":null,"spread":false},{"title":"hid.lib <span style='color:#111;'> 12.09KB </span>","children":null,"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 296B </span>","children":null,"spread":false},{"title":"usbioctl.h <span style='color:#111;'> 18.68KB </span>","children":null,"spread":false},{"title":"enum.c <span style='color:#111;'> 50.42KB </span>","children":null,"spread":false},{"title":"vndrlist.h <span style='color:#111;'> 20.91KB </span>","children":null,"spread":false},{"title":"winuser.h <span style='color:#111;'> 238.47KB </span>","children":null,"spread":false},{"title":"display.c <span style='color:#111;'> 31.80KB </span>","children":null,"spread":false},{"title":"dllmain.cpp <span style='color:#111;'> 410B </span>","children":null,"spread":false},{"title":"COMCTL32.LIB <span style='color:#111;'> 71.04KB </span>","children":null,"spread":false},{"title":"USBDetect.vcproj <span style='color:#111;'> 5.47KB </span>","children":null,"spread":false},{"title":"USBDetect.vcproj.PC-201008261742.Administrator.user <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"cfgmgr32.h <span style='color:#111;'> 82.86KB </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"usbview.c <span style='color:#111;'> 24.53KB </span>","children":null,"spread":false},{"title":"setupapi.lib <span style='color:#111;'> 137.74KB </span>","children":null,"spread":false},{"title":"debug.c <span style='color:#111;'> 4.03KB </span>","children":null,"spread":false},{"title":"usbview.h <span style='color:#111;'> 3.54KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

  • Lewhaming :
    很不错的资源,值得学习
    2020-06-05
  • vge_ :
    虽然不错,但只能遍历,如果20个USB口插入设备,无法做到一一对应。
    2019-04-13
  • lin415804 :
    挺好用的例子,就是有个bug在里面
    2018-06-13
  • weixin_40005351 :
    很好!刚好用得上!
    2018-05-23
  • xuyongli314159 :
    可以用的,比WDK自带的USBView要简单
    2016-11-17

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明