如何正确识别物理驱动器和计算机中的分区?我试过用GetVolumeInformation中的VOLUME序列号,并且很震惊地看到它返回一个NUMBER而不是一个字母数字值?为什么GetVolumeInformation为序列号返回一个int值?
[DllImport("Kernel32.dll", SetLastError = true)]
extern static bool GetVolumeInformation(string vol, StringBuilder name, int nameSize, out uint serialNum, out uint maxNameLen, out uint flags, StringBuilder fileSysName, int fileSysNameSize);
我需要知道USB拇指驱动器或CD或DVD或硬盘驱动器连接到另一台计算机时是同一个物理设备。即使在用户重命名或更改驱动器号后,我也需要知道分区或卷是否相同。