C# delete folder with all contents



C# delete folder with all contents

string filePath="C:\TempTest";

System.IO.Directory.Delete(filePath, True)


if the directory will not exist, then the code will return an error so that we will check the file in the drive after that we will delete.

if(Directory.Exists(filePath))

{

System.IO.Directory.Delete(filePath, True)

}

0 Comment's

Comment Form

Submit Comment