如何获得当前的驱动器数目及以及每个驱动器的属性

解决方案 »

  1.   

    char szDir[10]
    lstrcpy(szDir,"c:\\");
    for( int nIndex = 0; nIndex < 10; nIndex++)
    {
    szDir[0] = 'd' + nIndex;
    if(GetDriveType(szDir)==DRIVE_FIXED)
    }
      

  2.   

    char szDir[10]
    lstrcpy(szDir,"c:\\");
    for( int nIndex = 0; nIndex < 10; nIndex++)
    {
    szDir[0] = 'd' + nIndex;
    if(GetDriveType(szDir)==DRIVE_FIXED)
    }
      

  3.   

    获得逻辑驱动器用
    DWORD GetLogicalDriveStrings(
      DWORD nBufferLength,  // size of buffer
      LPTSTR lpBuffer       // pointer to buffer for drive strings
    );
      

  4.   

    获得逻辑驱动器的类型用 
    The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType(
      LPCTSTR lpRootPathName   // pointer to root path
    );