c0nstant
Cannot access file because it's being used by another process
I am getting the following error when I try to run my program:
System.IO.IOException: 'The process cannot access the file because it is being used by another process.'
I googled around and most suggestions want you to close the file stream when you are done with a file however the files that I am triyng to rename don't have a close method.
Here is my code:
So when I run this on a directory, it works on the first and sometimes the second file until something gets in the way. So what I need to do is force my program to rename files.
Any solutions to this?12 replies
✅ [SOLVED] Need help with converting async method to a 'normal' method
I tried a few solutions to be able to call an async method from my Main method but those have failed, here is the link:
https://stackoverflow.com/questions/9343594/how-to-call-asynchronous-method-from-synchronous-method-in-c
Here is my code:
So how do I go about converting this to something that I can easily call like a normal function from Main?
34 replies