如何检测USB闪存盘 [英] How to Detect USB Flash Drive

查看:156
本文介绍了如何检测USB闪存盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个程序,该程序将允许用户使用任何USB闪存盘作为密钥,插入该密钥后,它将自动(当然,经过验证)将登录名和密码数据输入到Web表单,应用程序,甚至Windows登录.但是首先要注意的是:例如,如何检测何时将USB密钥插入驱动器,也许只是检测到最后/最新插入的驱动器?

I am making a program that will allow a user to use any USB flash drive as a key, that when inserted, will automatically (upon validation, of course) enter login and password data into web forms, applications, and maybe even Windows Logon. But first things first: how to I detect when a USB key is inserted into the drive, for instance, perhaps just detect the last/latest inserted drive?

此外,有人知道是否有一种方法可以直接识别闪存驱动器,也许是基于序列号吗?而不是从设备上的文件进行验证?

In addition, does anyone know if there is a way to directly identify a flash drive, maybe based on a serial number?, rather than validating it from a file on the device?

无论如何,第一个问题是最重要的.

Anyway, the first question is the most important.

感谢您的帮助.

推荐答案

您可以像使用CD一样自动运行应用程序,这样就可以了只要用户安装了.NET Framework并已打开自动运行功能(提示:在Sony CD rootkit安装程序崩溃后,许多用户都将其禁用).

You can AutoRun enable your application, just like you would a CD, and this will work as long as the user has the .NET Framework installed and AutoRun turned on (Hint: Many users are disabling this after the Sony CD rootkit installer disaster).

如果您的软件已经安装在目标系统上,则可以观察驱动器的更改,并查看是否是USB驱动器正在安装的驱动器,然后激活您的应用程序.一些医疗设备闪存卡读取器使用此方法.

If you have your software already installed on the target system, you could watch for drive changes and see if it was your USB drive was the one being mounted and then activate your app. Some medical device flash card readers use this method.

对于设备的ID,这是制造商的事情.如果要使用特定品牌和型号的USB,则可以获取它的规格并使用它来确定它是否属于您.这是我在医疗设备SD卡上看到的另一件事.但是,如果它可以是任何USB驱动器,那么基于文件的方法将是您的最佳选择.

As for ID'ing the device, this is a manufacturer thing. If you're going to use a specific brand and model of USB, then you can get the specs for it and use this to determine if it's yours or not. That's another thing I've seen done on medical device SD cards. But if it can be any USB drive, then a file based method is going to be your best shot.


这篇关于如何检测USB闪存盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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