sDrivePath } 那么这个sDrivePath 就是一个一个的类似于C:/,D:/那样的字符窜 2.获取驱动器类型 现在获得了驱动器的路径了,如C:/,D:/ 那么如何区分他们呢, 有这个函数 GetDriveType The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, UINT GetDriveType( LPCTSTR lpRootPathName // root directory ); UINT uDriveType = GetDriveType(sDrivePath U盘,都是DRIVE_REMOVABLE ,而硬盘和插入的移动硬盘,都是DRIVE_FIXED 靠:( 我们一个一个来试试吧 3.获取光驱 先捏软柿子:) UINT uDriveType = GetDriveType
GetLogicalDriveStrings(BUFSIZE-1,buf); SzDrive = (PCHAR)buf; DWORD dwLastErr; DWORD dwFileSystemFlags; while(GetDriveType
cstring> #define BUFSIZE 1024 LPSTR GetDirverInfo(LPSTR szDrive) { UINT uDriveType; uDriveType = GetDriveType
stdio.h> #include <Windows.h> void GetDrivesType(const char* lpRootPathName) { UINT uDriverType = GetDriveType count; } // 获取驱动器类型 std::string GetDrivesType(const char* lpRootPathName) { UINT uDriverType = GetDriveType
driveType; QString driveName = storage.name(); #ifdef Q_OS_WIN driveType = GetDriveType
{ Sleep(10); CString strdriver = DStr + i * 4; CString strTmp, strTotalBytes, strFreeBytes; DType = GetDriveType (strdriver);//GetDriveType函数,可以获取驱动器类型,参数为驱动器的根目录 switch (DType) { case DRIVE_FIXED: { strTmp.Format continue; } letter = (CHAR)(0x41 + i); //ASCII change sprintf(path, "%c:\\", letter); driveType = GetDriveType
/ 释放内存 ---- 文件系统 一、卷相关API GetLogicalDrives // 获取逻辑驱动器 获取卷 GetLogicalDriveStrings // 获取所有盘符的字符串 GetDriveType
RemoveDirectory(“C:\\a”); 检测逻辑驱动器: GetLogicalDrives(); GetLogicalDriveStrings(len,buf); 获取驱动器类型(DRIVE_CDROM): GetDriveType
Sleep(10); CString strdriver = DStr+i*4; CString strTmp,strTotalBytes,strFreeBytes; DType = GetDriveType (strdriver);//GetDriveType函数,可以获取驱动器类型,参数为驱动器的根目录 switch (DType) { case DRIVE_FIXED:
; char filename[MAX_PATH] = { 0 }; while (*szSingleDrive) { if (GetDriveType
返回值是10进制.我们需要转化成16进制.然后转换成二进制查看.每一位为1代表有这个磁盘.否则则没有 GetLogIcalDriveStrings(buffsize,buf) 获取一个卷的盘符的字符串 GetDriveType
begin for i := 0 to 25 do //遍历26个字母 begin D := Chr(i + 65); Str := D + ':'; DiskType := GetDriveType
; 显示D盘invoke ExitProcess,0main ENDPEND main获取磁盘类型:.datalpDrive DB "c:\",0.codemain PROCinvoke GetDriveType
invoke ExitProcess,0 main ENDP END main 获取磁盘类型: .data lpDrive DB "c:\",0 .code main PROC invoke GetDriveType
在一个缓冲区中装载当前目录 GetDiskFreeSpace 获取与一个磁盘的组织有关的信息,以及了解剩余空间的容量 GetDiskFreeSpaceEx 获取与一个磁盘的组织以及剩余空间容量有关的信息 GetDriveType