C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

taking backup for txt file in c#


Posted Date: 24 Sep 2008      Posted By: Kumar R      Member Level: Gold     Points: 1   Responses: 1



hi ...

while updating a text file i need to take backup before updateing text file in c#





Responses

Author: Sam    24 Sep 2008Member Level: BronzeRating: 2 out of 52 out of 5     Points: 5

Hi,
See the below code,

if(!Directory.Exists(url_destine))

Directory.CreateDirectory(url_destine);



string path_file_destine = string.Empty;



foreach (string file in Directory.GetFiles(url_source))

{

path_file_destine= url_destine+Path.GetFileName(file);

File.Copy(file, path_file_destine);

}


Regards,
Sampath



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Visual Source Safe
Previous : Correct This Code..
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use