Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Force File Delete During Move?

I have downloaded updates into a local directory with an appended _ to allow the download to occure without errors.

Now I would like to use something like this: to overwrite the original file...

FileInfo fi = new FileInfo(@"C:\MyProgramRoot\Sub1\");
               
System.IO.File.Move(fi +"new text document.txt_", fi+ "new text document.txt");
0
kvnsdr
Asked:
kvnsdr
1 Solution
 
Expert1701Commented:
I believe you will be limited to:

  System.IO.File.Copy(fi + "new text document.txt_", fi + "new text document.txt", true);
  System.IO.File.Delete(fi + "new text document.txt_");
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now