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:
- MySQL driver compiling method of QT under windows and solutions to abnormal errors
- Solving the problem of Chinese garbled code in qtring
- Vs2019 + QT parses the XML file and reports an error at doc.setcontent (& file)
- Leetcode: 7. Reverse Integer(JAVA)
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- 7. Reverse Integer [easy] (Python)
- Random number random reports an error. Illegalargumentexception: bound must be positive
- Mac USB error 3: Unable to claim interface: Access denied (insufficient permissions)
- About the prompt: invalid use of incomplete type
- Error: l6218e: undefined symbol appears when keil calls lib
- C + + uses system (“pause”) to pause black windows
- The nvidia-smi has failed because it could’t communicate with the NVIDIA driver
- NVIDIA docker failed to start normally
- [Two Sigma OA] Longest Chain
- How to use C # to get image format without system. Drawing. Common
- Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNot
- Failed to bind properties under ‘‘ to com.zaxxer.hikari.HikariDataSource:
- Use NVIDIA to solve NVIDIA’s
- Write about the problems and solutions when configuring OpenGL in vs2015
- Can’t multiply sequence by non int of type ‘float’