如何正確識別物理驅動器和計算機中的分區?我試過用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或硬盤驅動器連接到另一臺計算機時是同一個物理設備。即使在用戶重命名或更改驅動器號後,我也需要知道分區或卷是否相同。