@获取驱动器属性_WindowsAPI
#GetDiveType
API链接: link.
代码如下:
BOOL GetDriverInfo(LPSTR szDrive)
{
printf("%s\n", szDrive);
UINT uDriveType;//根据返回值确定驱动器类型
uDriveType = GetDriveType(szDrive);
switch(uDriveType)
{
case DRIVE_UNKNOWN:
printf("The drive type cannot be determined.");
break;
case DRIVE_NO_ROOT_DIR:
printf("The root path is invalid, for example, no volume is mounted at the path.");
break;
case DRIVE_REMOVABLE://移动盘
printf("The drive is a type that has removalbe media, for example, a floppy drive or removable hard disk.");
break;
case DRIVE_FIXED://硬盘
printf("The drive is a type that cannot be removed, for example, a fixed hard drive.");
break;
case DRIVE_REMOTE://远程盘
printf("The drive is a remote (network) drive.");