如何通过USB线检测平板电脑是否已连接到PC? [英] How can I detect a tablet PC has connected to the PC via the USB cable?

查看:98
本文介绍了如何通过USB线检测平板电脑是否已连接到PC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在平板电脑通过USB线连接到PC时启动我的应用程序,我找到一些关于检测USB闪存盘而不是平板电脑的文章,我对这些技术知之甚少,你能给我一些吗?提示或示例?我只想检测平板电脑连接到PC的事件。

I want to start my application when the tablet PC has connected to the PC via the USB cable,I find some articles about detect the USB Flash Disk rather than the tablet,I know little about these technologies,Can you give me some tips or examples? I just want to detect the event that the tablet PC has connected to the PC.

推荐答案

查看 link [ ^ ]



并使用Driveinfo您可以使用各种属性来检测平板电脑



go through below code provided in link[^]

and using Driveinfo you can use various properties to detect tablet PC

using System.IO.DriveInfo;

 var availableDrives = DriveInfo.GetDrives()
.Where(d=> d.IsReady && d.DriveType == DriveType.Removable);


在Win7中?如果这是第一次进行此类连接,您的PC需要一个驱动程序来启动您的平板电脑。在正常情况下,您的操作系统将搜索并下载匹配的驱动程序,您可以安装它。之后,您可以在计算机中找到平板电脑的内容。
In Win7? If it's the first time of this kind connection, your PC need a drive program to start your tablet PC. Under normal conditions, your OS will search and download a matched driver and you can install it. After that you can find contents of your tablet PC in your computer.


这篇关于如何通过USB线检测平板电脑是否已连接到PC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆