Beispiel #1
0
        public static void EmptyPath(string root)
        {
            if (Directory.Exists(root))
            {
                Stack <string> paths;

                paths = new Stack <string>();
                paths.Push(root);

                do
                {
                    string path;

                    path = paths.Pop();

                    ShellHelpers.DeleteFiles(path);

                    foreach (string child in Directory.EnumerateDirectories(path))
                    {
                        paths.Push(child);
                    }
                } while (paths.Count > 0);
            }
        }