using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace SmartScanner.ImageService
|
{
|
class MemoryAlarmCheck
|
{
|
private (double usedPercentage, string driveName) GetDriveUsage()
|
{
|
// 获取系统盘
|
DownloadData downloadData = new DownloadData();
|
DriveInfo drive = new DriveInfo($"{downloadData.SetDataSavingRoad.Text}");
|
double totalSpace = drive.TotalSize;
|
double freeSpace = drive.AvailableFreeSpace;
|
double usedPercentage = 100 - (freeSpace / totalSpace * 100);
|
|
return (usedPercentage, drive.Name);
|
}
|
}
|
}
|