Check out example codes for "how to delete all files in a directory c#". It will help you in understanding the concepts better.

Code Example 1

System.IO.DirectoryInfo di = new DirectoryInfo("YourPath");

foreach (FileInfo file in di.GetFiles())
{
    file.Delete(); 
}
foreach (DirectoryInfo dir in di.GetDirectories())
{
    dir.Delete(true); 
}

Code Example 2

File.Delete(@"C:\Temp\Data\Authors.txt");

Learn ReactJs, React Native from akashmittal.com