header file:
#include < windows.h>
implementation:
quint64 ImageSave::getDiskFreeSpace(QString _driver)
{
LPCWSTR lpcwstrDriver = (LPCWSTR)_driver.utf16();
ULARGE_INTEGER liFreeBytesAvailable, liTotalBytes, liTotalFreeBytes;
if (!GetDiskFreeSpaceEx(lpcwstrDriver, &liFreeBytesAvailable, &liTotalBytes, &liTotalFreeBytes))
{
qDebug() << "ERROR: Call to GetDiskFreeSpaceEx() failed.";
return 0;
}
return (quint64)liTotalFreeBytes.QuadPart/1024/1024/1024;//返回单位G
}
p>
div>
Read More:
- Disk read error solution for new hard disk installation
- U disk installation Linux system could not boot, / dev / root does not exist and the identified hard disk space is not available
- Windows 10 upgrade 1803 failed because of dual hard disk!!
- Solutions to the problem that Ubuntu is stuck when copying large files and can’t mount mobile hard disk normally
- VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!
- Latex sets page margin, page size, page margin and geometry macro package
- Non system disk or disk error
- Solve the problem of non system disk or disk error, replace and strike any key when ready
- QT encountered in CentOS installation( qt.qpa.plugin : Could not load the Qt platform plugin “xcb” )
- The computer can’t turn on ERROR: NO BOOT DISK HAS BEEN DETECTED OR THE DISK HAS FAILED
- WSL start QT error qt.qpa.xcb : could not connect to display :0.0
- QT learning 3: configuration and testing of QT creator 2.4.1 development environment
- Invalidation of margin top property of nested box in CSS style box
- Bindtextureimage: cleaning GL error: 0x502 during Android opengles2.0 hard decoding
- Upgrading QT4 project to Qt5 project
- QGIS uses qt4.6.3 to upgrade to the version compiled by qt4.8.3
- Can not start, can not find QT pligins “windows” problem after installing QT vs environment 2021-06-13
- Solve the problem that WSL occupies too much C disk
- Win10 must be optimized after installation to solve 100% disk occupation
- Troubleshooting of “disk I / O error” after startup