Solved

Best way to synchronize 2 folders

Posted on 2006-11-01
3
199 Views
Last Modified: 2010-04-23
Hi experts

i have to make a program that synchronize 2 folders
but i'm asking if there is a smart way to do this because the only way i know if to loop throught all files in one folder and check if exist in the other
but when the program crash in the middle thread, i have to loop from the beginning, that's not very handy...

so i'm sure there is a way to make this smartly...

please let me know how you will do this if you have to sync 2 folders smartly

any suggestion are welcome...

regards

0
Comment
Question by:Dnx_7
3 Comments
 
LVL 10

Assisted Solution

by:ericwong27
ericwong27 earned 50 total points
ID: 17849216
Hi,

If the coding is not the "must-do" then try to use SyncToy v1.4 (Freeware from Microsoft)

http://www.microsoft.com/downloads/details.aspx?familyid=E0FC1154-C975-4814-9649-CCE41AF06EB7&displaylang=en
0
 
LVL 5

Accepted Solution

by:
DEEPESH earned 450 total points
ID: 17849363
I don't know what you have code but if i have to do it i would do it in this manner
You can use FileSystemWatcher and whenever changes take palce in the folder, start copying,
Second check each file through io.File.Exists on destination path, if not then use io.file.copy

Visit the links it may help
http://vbnet.mvps.org/index.html?code/fileapi/copyfile.htm
http://dotnetjunkies.com/Forums/ShowPost.aspx?PostID=1547

I think what you are doing is correct
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 17859340
thank you guys...
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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

15 Experts available now in Live!

Get 1:1 Help Now