private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { AutoDeleteTimer.Enabled = true; AutoDeleteTimer.Start(); } else { AutoDeleteTimer.Stop(); AutoDeleteTimer.Enabled = false; } }
private void AutoDeleteTimer_Tick(object sender, EventArgs e) { var Drive = DriveInfo.GetDrives().First(o => o.Name == @"C:\"); if (Drive != null) { if (Drive.AvailableSpaceInGB() == 5 || VRChatCacheDir.GetDirectorySizeInGB() > 19) // Drive Space Is Less Than 5GB Or Cache Is Full { AutoDeleteTimer.Stop(); AutoDeleteTimer.Enabled = false; ClearVRCCache(); AutoDeleteTimer.Enabled = true; AutoDeleteTimer.Start(); } } label2.Text = $"Last Known Free Drive Space: {Drive.AvailableSpaceInGB()}GB - Last Known Cache Size: {VRChatCacheDir.GetDirectorySizeInGB()}GB"; }