因为它是API。你在代码中写上GetDriveType,然后把光标移到上面按F1。

解决方案 »

  1.   

    可以在SDK中找到
    delphi带有的
      

  2.   

    The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType(    LPCTSTR lpRootPathName  // address of root path 
       );
     ParameterslpRootPathNamePoints to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.  Return ValuesThe return value specifies the type of drive. It can be one of the following values: Value Meaning
    0 The drive type cannot be determined.
    1 The root directory does not exist.
    DRIVE_REMOVABLE The drive can be removed from the drive.
    DRIVE_FIXED The disk cannot be removed from the drive.
    DRIVE_REMOTE The drive is a remote (network) drive.
    DRIVE_CDROM The drive is a CD-ROM drive.
    DRIVE_RAMDISK The drive is a RAM disk.
     See AlsoGetDiskFreeSpace 
      

  3.   

    case GetDriveType('c:\') of
        0:
            showmessage('The drive type cannot be determined');
        1:
            showmessage('The root directory does not exist');
        DRIVE_REMOVABLE:
            showmessage('The drive can be removed from the drive.');
        DRIVE_FIXED:
            Showmessage('The disk cannot be removed from the drive.');
        DRIVE_REMOTE:
            showmessage('The drive is a remote (network) drive.');
        DRIVE_CDROM:
            Showmessage('The drive is a CD-ROM drive.');
        DRIVE_RAMDISK:
            Showmessage('The drive is a RAM disk.');
    end;
      

  4.   

    多谢各位!!
    怎样得到当前计算机的所有驱动器,
    例程中定义的一个类型没有
    DriveType:TDriveType;
      

  5.   

    用for 循环从a-z
    依次用getdrivetype判断
    如果有一个驱动器返回值为0后面就不用判断了
      

  6.   

    也可以直接用GetLogicalDriveStrings:The GetLogicalDriveStrings function fills a buffer with strings that specify valid drives in the system. DWORD GetLogicalDriveStrings(    DWORD nBufferLength, // size of buffer 
        LPTSTR lpBuffer  // address of buffer for drive strings 
       );
     ParametersnBufferLengthSpecifies the maximum size, in characters, of the buffer pointed to by lpBuffer. This size does not include the terminating null character. lpBufferPoints to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, that end with a second null character. The following example shows the buffer contents with <null> representing the terminating null character. c:\<null>d:\<null><null>  
     Return ValuesIf the function succeeds, the return value is the length, in characters, of the strings copied to the buffer, not including the terminating null character. Note that an ANSI-ASCII null character uses one byte, but a Unicode null character uses two bytes. 
    If the buffer is not large enough, the return value is greater than nBufferLength. It is the size of the buffer required to hold the drive strings. 
    If the function fails, the return value is zero. To get extended error information, use the GetLastError function.