I have a windows service running that deletes folders from network drive. I want to make the deleting asynchronous. How can this be done?
Right now i am looping through the directories and calling
Directory.Delete(fullPath, true);
Thanks
I would use the Task Parallel Library:
Task.Factory.StartNew(path => Directory.Delete((string)path, true), fullPath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With