prasoon tiwari

prasoon tiwari

  • NA
  • 2
  • 662

Delete a directory while maintaining integrity of code

May 14 2020 11:03 PM
Hi,
 
I am using Delete function to delete a directory.
However my next line of code starts executing even before the delete operation is finished..
Can someone help how to ensure that delete transaction is completed before code moves to next line?
 
 
Directory.Delete(GlobalVar.IMAGING_FOLDER, true);
 
//Some code to ensure that Folder is deleted successfully before moving to belwo next line of code.
 
ExtractFile(SourceFile, DestinationFolder);
 

Answers (2)