Using .NET's WMI to Identify Pen-Drive's Unique ID
-
Hello, I have been trying to modify the available .NET WMI examples on The Code Project so that I could uniquely identify a pen-drive (usb key). Unlike the hard disks, pen drives do not expose a property like UniqueID. Any ideas of what I could use to uniquely identify it? I have already read and tried the "normal" examples available on .NET's WMI. Thank you all in advance, Vini - CSharping a lot
-
Hello, I have been trying to modify the available .NET WMI examples on The Code Project so that I could uniquely identify a pen-drive (usb key). Unlike the hard disks, pen drives do not expose a property like UniqueID. Any ideas of what I could use to uniquely identify it? I have already read and tried the "normal" examples available on .NET's WMI. Thank you all in advance, Vini - CSharping a lot
Hi! I think Win32_DiskDrive.PNPDeviceID is unique. I tried it with two idential usb sticks and they gave different PNPDeviceID's.
Regards, mav -- Black holes are the places where god divided by 0...
-
Hi! I think Win32_DiskDrive.PNPDeviceID is unique. I tried it with two idential usb sticks and they gave different PNPDeviceID's.
Regards, mav -- Black holes are the places where god divided by 0...
mav.northwind wrote:
Hi! I think Win32_DiskDrive.PNPDeviceID is unique. I tried it with two idential usb sticks and they gave different PNPDeviceID's.
Hi Mav... Tried that but unfortunately I think I couldn't use that, as windows gives your pen-drive a different PNPDeviceID each time you plug it in. =) I needed something that could tell "Oh, this is Jimmy's pen-drive" for instance. I am developing an app in which, along with user and password, the client system has to provide an unique ID for the pen-drive being used with the app. Any other ideas? Regards... Vini
-
mav.northwind wrote:
Hi! I think Win32_DiskDrive.PNPDeviceID is unique. I tried it with two idential usb sticks and they gave different PNPDeviceID's.
Hi Mav... Tried that but unfortunately I think I couldn't use that, as windows gives your pen-drive a different PNPDeviceID each time you plug it in. =) I needed something that could tell "Oh, this is Jimmy's pen-drive" for instance. I am developing an app in which, along with user and password, the client system has to provide an unique ID for the pen-drive being used with the app. Any other ideas? Regards... Vini
-
mav.northwind wrote:
Hi! I think Win32_DiskDrive.PNPDeviceID is unique. I tried it with two idential usb sticks and they gave different PNPDeviceID's.
Hi Mav... Tried that but unfortunately I think I couldn't use that, as windows gives your pen-drive a different PNPDeviceID each time you plug it in. =) I needed something that could tell "Oh, this is Jimmy's pen-drive" for instance. I am developing an app in which, along with user and password, the client system has to provide an unique ID for the pen-drive being used with the app. Any other ideas? Regards... Vini
ReHi! At least with the 4 sticks (3 different brands) I tried it with, they all kept their PNPDeviceID, even when I plugged them into another computer. But your mileage may vary...
Regards, mav -- Black holes are the places where god divided by 0...
-
ReHi! At least with the 4 sticks (3 different brands) I tried it with, they all kept their PNPDeviceID, even when I plugged them into another computer. But your mileage may vary...
Regards, mav -- Black holes are the places where god divided by 0...
mav.northwind wrote:
At least with the 4 sticks (3 different brands) I tried it with, they all kept their PNPDeviceID, even when I plugged them into another computer. But your mileage may vary...
You're quite right, mav... Looking through msinfo32.exe I could check that it remains the same, actually. I also tested on another workstation. Thanks a lot for your help. And btw: the link that Dave (if Im not wrong) posted is very nice. If you wanna take a peek: http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx Cheers,
-
mav.northwind wrote:
At least with the 4 sticks (3 different brands) I tried it with, they all kept their PNPDeviceID, even when I plugged them into another computer. But your mileage may vary...
You're quite right, mav... Looking through msinfo32.exe I could check that it remains the same, actually. I also tested on another workstation. Thanks a lot for your help. And btw: the link that Dave (if Im not wrong) posted is very nice. If you wanna take a peek: http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx Cheers,
Marcos Accioly wrote:
And btw: the link that Dave (if Im not wrong) posted is very nice. If you wanna take a peek: http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx
Yup, I already browsed through it. Very nice, indeed. :)
Regards, mav -- Black holes are the places where god divided by 0...
-
Marcos Accioly wrote:
And btw: the link that Dave (if Im not wrong) posted is very nice. If you wanna take a peek: http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx
Yup, I already browsed through it. Very nice, indeed. :)
Regards, mav -- Black holes are the places where god divided by 0...
Hi again mav, I actually tried the PNPDeviceID for my LG UP3D USB Device and it simply informed nothing. *But* going to msinfo32.exe gives me the following output: LG UP3D USB Device USBSTOR\DISK&VEN_LG_UP3D&PROD_&REV_\200508010001&0 USB Mass Storage Device USB\VID_043E&PID_7090\200508010001 which tells me that windows actually has a PNPDeviceId for it, that being VID_043E&PID_7090 (according to the article at Coding4Fun about the wireless usb PC Lock). Now the question is: Why? you can check out a printscreen I've done of the simple app for identifying the hardware HERE Cheers, Vini
-
Hi again mav, I actually tried the PNPDeviceID for my LG UP3D USB Device and it simply informed nothing. *But* going to msinfo32.exe gives me the following output: LG UP3D USB Device USBSTOR\DISK&VEN_LG_UP3D&PROD_&REV_\200508010001&0 USB Mass Storage Device USB\VID_043E&PID_7090\200508010001 which tells me that windows actually has a PNPDeviceId for it, that being VID_043E&PID_7090 (according to the article at Coding4Fun about the wireless usb PC Lock). Now the question is: Why? you can check out a printscreen I've done of the simple app for identifying the hardware HERE Cheers, Vini
The wonders of windows... I'm afraid I don't have the faintest idea why :(
Regards, mav -- Black holes are the places where god divided by 0...