#include <windows.h>
#include <stdio.h>
int main()
{
switch(GetDriveType("g:\\"))
{
case DRIVE_UNKNOWN: printf("未知!\n"); break;
case DRIVE_NO_ROOT_DIR: printf("无效!\n"); break;
case DRIVE_REMOVABLE: printf("可移动磁盘!\n"); break;
case DRIVE_FIXED: printf("固定磁盘!\n"); break;
case DRIVE_REMOTE: printf("网络磁盘!\n"); break;
case DRIVE_CDROM: printf("光驱!\n"); break;
case DRIVE_RAMDISK: printf("内存!\n"); break;
}
return 0;
}
【原】VC检测磁盘类型(代码)
最新推荐文章于 2022-03-31 13:56:14 发布