Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to know idea using file updating.if i have a 2 folder named folder1 and folder2, in both folder i create same name file like myfile.txt. if any one update myfile.txt in folder1 then automatically update myfile.txt in folder2. so, can any one help to share idea behind logic?
Posted
Comments
[no name] 15-Jul-15 7:47am    
You already have the "idea behind logic".
Thava Rajan 15-Jul-15 8:02am    
do you done a web or windows app

1 solution

Assuming this is C# Winforms, and the PHP reference is spurious...

The first thing you need to do is detect the change: FileSystemWatcher class[^] - but do also read this pretty carefully: FileSystemWatcher - Pure Chaos (Part 1 of 2)[^]
Then it's relatively simple: File.Copy within a try...catch block in case the file is busy, with a retry if it is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900