Error when deleting all files from a directory

Hi,

I’m trying to clear all the available files from my downloads folder using the C# code. But it is failing.

Adding the xaml file for reference.

When this xaml file is executed, it delete all the files. However, when i copy paste the same into an existing process, it is throwing an error. Adding the error details also.

Please suggest if there are any other ways to delete all the files from downloads folder.

Test.xaml (5 KB)

Hey

please try with this method
Test.xaml (6.5 KB)

Regards

HI @Karthikeyan_CS

Try to use like this

System.IO.Diretory.GetFiles(".....")

Regards
Sudharsan