Cannot access file because it's being used by another process
I am getting the following error when I try to run my program:
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?
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?