Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Detect an USB key

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Romain TAILLANDIER - 10 Jan 2008 17:58 GMT
Hi group !

I am trying to detect my specific USB periphéral. It have a specific
VID and PID, but it is like an USB key

My goal is to detect plugged/unplugged USB peripherals, and check if
it is mine (using the VID PID), and do something at this time. in C#

Now,
- I am able to detect any USB peripheral connection, and react. i
found this on CodeProject in 5 or 6 different ways.
- I am able to know what is the volume name, and letter of all drives
(CodeProject)
- I am able to know if my Specific peripheral is connected by looking
at registry (HKLM\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR\\Enum)
- I am able to found my drive using the registry (HKEY_CURRENT_USER
\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC
\Volume) and parsing the name of the drive in a binary data key (very
dirty i know, but it is my only workaround, and i am not sure it work
for the moment)

But i can't get the link between the drive letter, and the VID / PID.

Please indicate me any way to perform this.

Thank you.
Cowboy (Gregory A. Beamer) - 11 Jan 2008 04:00 GMT
The guys who created SharpZipLib have a USB lib for .NET (which uses an
underlying USB lib created by someone else for COM). I am not sure if it
will give you everything, but that is where I would look first.

http://www.icsharpcode.net/OpenSource/SharpUSBLib/default.aspx

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
Hi group !

I am trying to detect my specific USB periphéral. It have a specific
VID and PID, but it is like an USB key

My goal is to detect plugged/unplugged USB peripherals, and check if
it is mine (using the VID PID), and do something at this time. in C#

Now,
- I am able to detect any USB peripheral connection, and react. i
found this on CodeProject in 5 or 6 different ways.
- I am able to know what is the volume name, and letter of all drives
(CodeProject)
- I am able to know if my Specific peripheral is connected by looking
at registry (HKLM\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR\\Enum)
- I am able to found my drive using the registry (HKEY_CURRENT_USER
\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC
\Volume) and parsing the name of the drive in a binary data key (very
dirty i know, but it is my only workaround, and i am not sure it work
for the moment)

But i can't get the link between the drive letter, and the VID / PID.

Please indicate me any way to perform this.

Thank you.
Romain TAILLANDIER - 14 Jan 2008 15:22 GMT
Thank you greg.

This seems good, but i search a full .net implementation, ere is a lot
of native code first then a C# use f this native implementation.
It is not acceptable in my case. I will contact the one who write the
C code, to help to convert it in C#. Seems to be a lot of work ....

Thank for other help.

On 11 jan, 05:00, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
> The guys who created SharpZipLib have aUSBlib for .NET (which uses an
> underlyingUSBlib created by someone else for COM). I am not sure if it
[quoted text clipped - 5 lines]
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.