使用代碼未知的數據如下,以獲得我的驅動器的名稱:掌握GetLogicalDriveStrings()
const DWORD buffer_length = sizeof(DWORD)*CHAR_BIT;
WCHAR buffer[buffer_length] = {0};
GetLogicalDriveStrings(buffer_length,buffer);
std::set<wchar_t> drives_letters;
for(auto e : buffer)
{
drives_letters.insert(e);
}
我得到以下的結果輸出(遍歷drives_letters):
: //what on earth is this?
C
D
E
F
G
I
\ //and what on earth is this?
你試過GetDriveType,看看它返回? – dowhilefor 2012-01-14 15:55:49
@dowhilefor現在正在處理它 – smallB 2012-01-14 15:56:55