Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How to delete folder with files on c#

Directory.Delete(@"folderPath", true);
Comment

c# delete files in directory and subdirectories

 public static void RecursiveDelete(DirectoryInfo parentDir)
        {
            if (parentDir.Exists)
            {
                foreach (var dir in parentDir.EnumerateDirectories())
                {
                    RecursiveDelete(dir);
                }

                var files = parentDir.GetFiles();
                foreach  (var item in files)
                {
                    item.IsReadOnly = false;
                    item.Delete();
                }

                parentDir.Delete(true);
            }
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity rotate around axis 
Csharp :: c# display image 
Csharp :: how to write coroutine in unity 
Csharp :: c# #region #endregion 
Csharp :: addd to array c# 
Csharp :: C# select keyword lambda 
Csharp :: how to concatenate two arrays in c# 
Csharp :: list min and Max value in c# 
Csharp :: unity onclick object 
Csharp :: c# set cursor to loading and back 
Csharp :: what is void onmousedown() 
Csharp :: char array 
Csharp :: Winform on exit run method 
Csharp :: c# api bypass ssl certificate 
Csharp :: stringify c# 
Csharp :: .net core 6 autofac 
Csharp :: linked list revrse 
Csharp :: c# form set auto scale 
Csharp :: c# color to console color 
Csharp :: visual studio c# mark class deprecated 
Csharp :: remove item from list in for loop c# 
Csharp :: mysql: [Warning] Using a password on the command line interface can be insecure. 
Csharp :: microsoft forms create bitmap 
Csharp :: how to have referecne to script in unity 
Csharp :: finding keys in the registry 
Csharp :: freeze scene unity 
Csharp :: combobox in datagrid wpf 
Csharp :: c# $ string 
Csharp :: unity auto scroll 
Csharp :: decimal operator in Convert.toDouble() C# 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =