Solved

Force File Delete During Move?

Posted on 2006-10-25
1
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why use this lambda? 12 95
Problem to copy file 14 89
Stop Git from being my repository 1 49
Adjust the codes 3 63
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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