0
A
回答
2
BOOL WINAPI GetVolumeInformation(
__in_opt LPCTSTR lpRootPathName,
__out LPTSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags,
__out LPTSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize
);
http://msdn.microsoft.com/en-us/library/aa364993(v=VS.85).aspx
傳遞體積根路徑(如「C:\」)中,獲得了大量的信息(包括卷名,也稱爲卷標)出來。
可用自Windows 2000
0
您可以從該代碼得到它:
BOOL WINAPI GetVolumeNameForVolumeMountPoint(
__in LPCTSTR lpszVolumeMountPoint,
__out LPTSTR lpszVolumeName,
__in DWORD cchBufferLength
);
更多參考Click here
2
使用下面的代碼片段:
TCHAR volumeName[MAX_PATH + 1] = { 0 };
TCHAR fileSystemName[MAX_PATH + 1] = { 0 };
DWORD serialNumber = 0;
DWORD maxComponentLen = 0;
DWORD fileSystemFlags = 0;
if (GetVolumeInformation(
_T("C:\\"),
volumeName,
ARRAYSIZE(volumeName),
&serialNumber,
&maxComponentLen,
&fileSystemFlags,
fileSystemName,
ARRAYSIZE(fileSystemName)))
{
_tprintf(_T("Volume Name: %s\n"), volumeName);
_tprintf(_T("Serial Number: %lu\n"), serialNumber);
_tprintf(_T("File System Name: %s\n"), fileSystemName);
_tprintf(_T("Max Component Length: %lu\n"), maxComponentLen);
}
在我係統的輸出是:
Volume Name: Zion
Serial Number: 112749257
File System Name: NTFS
Max Component Length: 255
相關問題
- 1. 爲什麼我不能得到scrollTop的()
- 2. 捲曲選項 - 什麼選項是-u
- 3. 爲什麼我得到一個不存在的文件名?
- 4. 爲什麼我不能得到文件和目錄的名稱?
- 5. 爲什麼我得到「#1066 - 不是唯一的表/別名」?
- 6. 爲什麼我會得到#1064 - 你在你的SQL語法錯誤
- 7. 你在ctrl + u中代表什麼?
- 8. 不明白爲什麼字母U前綴我的raw_input的()
- 9. 爲什麼我得到這個名爲java.lang.ArrayIndexOutOfBoundsException的錯誤?
- 10. 爲什麼我得到ImportError:沒有名爲'PIL'的模塊?
- 11. 爲什麼我得到空
- 12. 爲什麼我得到.UnauthorizedAccessException?
- 13. 爲什麼我得到IllegalFormatConversionException?
- 14. 爲什麼我得到System.IndexOutOfRangeException:EmpPassword
- 15. 爲什麼我得到linebreaks?
- 16. 爲什麼我得到flask.redirect
- 17. 爲什麼我得到零
- 18. 爲什麼我得到java.lang.ClassNotFoundException?
- 19. 爲什麼我得到System.Data.DataRow?
- 20. 爲什麼我得到java.security.AccessControlException?
- 21. 爲什麼我得到502
- 22. 爲什麼我得到InvalidOperationException?
- 23. 爲什麼我得到StackOverflowError?
- 24. 爲什麼我得到{error?
- 25. 爲什麼我得到「=」
- 26. 爲什麼我得到NameError?
- 27. 爲什麼我得到NullReferenceException?
- 28. 爲什麼我得到java.lang.OutOfMemoryError?
- 29. 爲什麼我得到空?
- 30. 爲什麼我得到nullpointerexeption?