public static void ClearDownloadCache() { string downloadDir = GetDownloadDirectoryPath(); if (!String.IsNullOrWhiteSpace(downloadDir) && !FolderService.HasIllegalChars(downloadDir) && Directory.Exists(downloadDir)) { FolderService.Clear(downloadDir); } }
public static bool ClearDownloadCache() { string downloadDir = GetDownloadDirectoryPath(); if (String.IsNullOrWhiteSpace(downloadDir) || FolderService.HasIllegalChars(downloadDir) || !Directory.Exists(downloadDir)) { return(false); } return(FolderService.Clear(downloadDir)); }