void CGetSpaceDlg::OnBtngs()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CString strAllInfo;
//获得磁盘空间信息
ULARGE_INTEGER FreeAv,TotalBytes,FreeBytes;
if (GetDiskFreeSpaceEx(m_fpath,&FreeAv,&TotalBytes,&FreeBytes))
{
//格式化信息,并显示出来
CString strTotalBytes,strFreeBytes;
//strTotalBytes.Format("Total:%u bytes",TotalBytes.QuadPart);
//strFreeBytes.Format("Left:%u bytes",FreeBytes.QuadPart);
strTotalBytes.Format("Total:%luM",TotalBytes.QuadPart/(ULONGLONG)(1024*1024));
strFreeBytes.Format("Left:%luG",FreeBytes.QuadPart/(ULONGLONG)(1024*1024*1024));
strAllInfo.Format("Info:[%s] %s %s \nU can use %luG",m_fpath,strTotalBytes,strFreeBytes, FreeAv.QuadPart/(ULONGLONG)(1024*1024*1024));/* 单位为G */
MessageBox(strAllInfo);
}
}
阅读(6637) | 评论(1) | 转发(0) |