At.Okr.OKrBook.Auter.Main.ClearDirectory C# (CSharp) Method

ClearDirectory() private method

private ClearDirectory ( String path ) : void
path String
return void
        private void ClearDirectory(String path)
        {
            if (Directory.Exists(path))
            {
                String[] files = Directory.GetFileSystemEntries(path);

                foreach (var file in files)
                {
                    if (Directory.Exists(file))
                    {
                        ClearDirectory(file);
                    }
                    else
                    {
                        File.Delete(file);
                    }
                }
            }
        }