示例#1
0
        /// <summary>
        /// Removes the cache folders that were created by Selenium driver, since they take a lot of space (70MB+)
        /// </summary>
        /// <param name="acc">Account</param>
        public static void RemoveCache(Account acc)
        {
            var userFolder = IoHelperCore.GetCacheFolder(acc.AccInfo.Nickname, acc.AccInfo.ServerUrl, "");

            var removeFolders = Directory
                                .GetDirectories(CachePath + "\\")
                                .Where(x => x.Replace(CachePath + "\\", "").StartsWith(userFolder))
                                .ToArray();

            if (removeFolders == null)
            {
                return;
            }

            for (int i = 0; i < removeFolders.Count(); i++)
            {
                Directory.Delete(removeFolders[i], true);
            }
        }