Check files on 2 servers
I want to create an executable that can check folders on 2 servers and
synchronize them if files dont match.
Can some one please point me to the right direction (sample code etc..)
Thanks in advance,
Re: Check files on 2 servers
Dunno if I should =P
well I may have some pieces to you.
this will work on simple network:
if(ServerID[i] != "")
if(Directory.Exists("\\\\" + dp + "\\" + pathToDp + "\\" +
table = new DataTable("\\\\" + dp + "\\" + pathToDp + "\\" +
getAllFilesAndFolders("\\\\" + dp + "\\" + pathToDp + "\\" +
ServerID[i] , "\\\\" + dp + "\\" + pathToDp + "\\" + ServerID[i] , ref
ServerID[i] = "";
private void getAllFilesAndFolders(string path , string baseRoot,ref
foreach(string s in Directory.GetDirectories(path) )
string files = Directory.GetFiles(path);
foreach(string pkgFile in files)
row = table.NewRow();
row["File_Name"] = pkgFile.Replace(baseRoot,"");
well its not a working piece, need some fixes in some declarations.
Well what it does:
You put a path in the ServerID and it create a table with all the files
that are in the server, then all you have to do is create another table
with the files from the other server and compare then. Easy now right?
|All times are GMT. The time now is 03:56 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.