diff --git a/AutoTx/AutoTx.cs b/AutoTx/AutoTx.cs index 5dd7a992a02df9cc1fbfbd7fa123c1c9b205656d..f4dfd510f78aafde5a07c8af2e5b0b7e9f11dc51 100644 --- a/AutoTx/AutoTx.cs +++ b/AutoTx/AutoTx.cs @@ -29,6 +29,9 @@ namespace AutoTx private int _txProgress; + private const int MegaBytes = 1024 * 1024; + private const int GigaBytes = 1024 * 1024 * 1024; + private DateTime _lastUserDirCheck = DateTime.Now; // the transfer state: diff --git a/AutoTx/SystemChecks.cs b/AutoTx/SystemChecks.cs index 67a04893c2b6a4540b92795f6dd130cfc20ee808..4e7cad20b42b97c5c7fcfec928f02a50224e0b17 100644 --- a/AutoTx/SystemChecks.cs +++ b/AutoTx/SystemChecks.cs @@ -61,7 +61,7 @@ namespace AutoTx private long GetFreeDriveSpace(string drive) { try { var dInfo = new DriveInfo(drive); - return dInfo.TotalFreeSpace / 1048576; // convert bytes to MB + return dInfo.TotalFreeSpace / MegaBytes; } catch (Exception ex) { writeLog("Error in GetFreeDriveSpace(" + drive + "): " + ex.Message);