获取系统有几个逻辑分区

char cr[3]; char lable[12]; for(int n=0;n<=25;n++) { CString str; str.Format(“%c:”,n+’A’); strcpy(cr,str); int dt = GetDriveType(cr); int succeed = GetVolumeInformation(cr,lable,12,NULL,NULL,NULL,NULL,0); switch(dt) { case DRIVE_UNKNOWN: { str.Format(“(%s) %s is DRIVE_UNKNOWN!”,lable,cr); break; } case DRIVE_REMOVABLE: { if(succeed) { str.Format(“(%s) %s is DRIVE_REMOVABLE!”,lable,cr); } else { str.Format(“%s is DRIVE_REMOVABLE!”,cr); } break; } case DRIVE_FIXED: { str.Format(“(%s) %s is DRIVE_FIXED!”,lable,cr); break; } case DRIVE_REMOTE: { str.Format(“(%s) %s is DRIVE_REMOTE!”,lable,cr); break; } case DRIVE_CDROM: { str.Format(“(%s) %s is DRIVE_CDROM!”,lable,cr); break; } case DRIVE_RAMDISK: { str.Format(“(%s) %s is DRIVE_RAMDISK!”,lable,cr); break; } default: { str.Empty(); break; } } if(!str.IsEmpty()) { AfxMessageBox(str); } }

支持原创技术分享,据说打赏我的人,都找到了女朋友!