获取逻辑磁盘符

//第一种方法

DWORD dwDrive;
dwDrive = GetLogicalDrives();

//第二种方法

TCHAR RootPathName[MAX_PATH];
ZeroMemory(RootPathName,sizeof(RootPathName));
DWORD dwLen;
dwLen = GetLogicalDriveStrings(MAX_PATH,RootPathName);
for(int i=0;i<(int)dwLen;i=i+4)
{
printf("LogDrivesString:%c%c%c/n",RootPathName[i],RootPathName[i+1],RootPathName[i+2]);
}

你可能感兴趣的:(获取)