Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)
Hi, I download files from a website, the problem is every time I download the files names get updated and I don't want it. Is there a  way I can automate deleting the previously downloaded files ?

1 Answer

0 votes
by (29.5k points)
Hi, yes there is an easy way to do that just follow the steps given below

1) Use the method Directory.GetFiles()

2) provide the path of the directory where your files are saved

3) the above will return an array of files, you can apply a for each loop and delete them all

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
0 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...