[DllImport("kernel32.dll")]
private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer, UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength, ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);
private static void GetHDDInformation(string drive)
{
StringBuilder volumeName = new StringBuilder();
StringBuilder fileSystem = new StringBuilder();
uint harDiskSerial = 0;
uint dummy1 = 0;
uint dummy2 = 0;
GetVolumeInformation(drive, volumeName, 255, ref harDiskSerial, ref dummy1, ref dummy2, fileSystem, 255);
_hardDiskSerial = harDiskSerial;
}