Solved

Force File Delete During Move?

Posted on 2006-10-25
1
216 Views
Last Modified: 2010-04-16
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
Comment
Question by:kvnsdr
1 Comment
 
LVL 11

Accepted Solution

by:
Expert1701 earned 125 total points
ID: 17806812
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now