I've got a folder:
c:\test
I'm trying this code:
File.Move(@"c:\test\SomeFile.txt", @"c:\test\Test");
I get exception:
File already exists
The output directory definitely exists and the input file is there.
I've got a folder:
c:\test
I'm trying this code:
File.Move(@"c:\test\SomeFile.txt", @"c:\test\Test");
I get exception:
File already exists
The output directory definitely exists and the input file is there.
You can do a P/Invoke to
MoveFileEx()
- pass 11 forflags
(MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH
)Or, you can just call
after adding Microsoft.VisualBasic as a reference.