none
C# 遍历USB设备并判断类型 RRS feed

  • 问题

  • 如何使用C#遍历USB设备并判断其类型?类型有如:硬盘、摄像头、光驱等。

    等待高人,谢谢!

    2011年8月24日 12:15

答案

  • C#只是语言规范,没有访问硬件的功能。

    如果你的目标OS是PC版的Windows,可以用SetupDiEnumDeviceInfo。Windows Phone 7没有API提供枚举USB设备的API。




    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2011年8月24日 14:08
    版主

全部回复

  • C#只是语言规范,没有访问硬件的功能。

    如果你的目标OS是PC版的Windows,可以用SetupDiEnumDeviceInfo。Windows Phone 7没有API提供枚举USB设备的API。




    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2011年8月24日 14:08
    版主
  • C#只是语言规范,没有访问硬件的功能。

    如果你的目标OS是PC版的Windows,可以用SetupDiEnumDeviceInfo。Windows Phone 7没有API提供枚举USB设备的API。




    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    哦,谢谢!
    2011年8月25日 3:29
  • 不要被版主误导。请参考我的文章:C#:基于WMI查询USB设备
    2011年8月31日 7:53
  • USB 任何设备可以获取信息吗?usb 的读卡器的读卡的号码信息等。。。?

    Final Fantasy

    2012年7月26日 10:34