17 using System.Collections.Generic;
19 using System.Threading.Tasks;
29 private static readonly Queue<string> TemporaryPaths =
new Queue<string>();
32 public static string Get()
34 var newPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToStringInvariant(
null));
37 TemporaryPaths.Enqueue(newPath);
50 paths = TemporaryPaths.ToList(s => s);
51 TemporaryPaths.Clear();
53 Parallel.ForEach(paths, path =>
57 Directory.Delete(path, recursive:
true);