tags:

views:

171

answers:

2

As the question states I need some way of getting a unique ID for each of the drives attached to my PC.

The reason behind this is that if i store the location of a file in a DB and I want to retrieve it at a later stage I wont always get the file since the drive letters change depending on the number of drives plugged in.

+4  A: 

Hi, check this link

Get Volume Serial Number in C#

IordanTanev
A: 

Each harddisk/storage device has a serial number.

You need to query that value: http://stackoverflow.com/questions/1176053/read-usb-device-serial-number-in-c

Am
This is correct, but you probably don't need a hardware ID for this application. A volume serial number should be sufficient for locating a specific file.
finnw