FAQ200412: Getting system has several logical partitions

xiaoxiao2021-03-06  43

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 driving_unknown!", Lable, CR);

Break;

}

Case Drive_removable:

{

IF (success)

{

Str.Format ("(% s)% s it drive_removable!", lable, cr);

}

Else

{

Str.Format ("% s is drive_removable!", cr);

}

Break;

}

Case drive_fixed:

{

Str.Format ("(% s)% s is driving_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 driving_ramdisk!", lable, cr);

Break;

}

DEFAULT:

{

Str.empty ();

Break;

}

}

IF (! str.isempty ())

{

AfxMessageBox (STR);

}

}

转载请注明原文地址:https://www.9cbs.com/read-75218.html

New Post(0)