Dunno if I should =P
well I may have some pieces to you.
this will work on simple network:
for(int i=0;i<ServerID.Length;i++)
{
if(ServerID != "")
{
if(Directory.Exists("\\\\" + dp + "\\" + pathToDp + "\\" +
ServerID ))
{
table = new DataTable("\\\\" + dp + "\\" + pathToDp + "\\" +
ServerID);
table.Columns.Add("File_Name",Type.GetType("System.String"));
getAllFilesAndFolders("\\\\" + dp + "\\" + pathToDp + "\\" +
ServerID , "\\\\" + dp + "\\" + pathToDp + "\\" + ServerID , ref
table);
ds.Tables.Add(table);
ServerID = "";
}
}
private void getAllFilesAndFolders(string path , string baseRoot,ref
DataTable table)
{
DataRow row;
foreach(string s in Directory.GetDirectories(path) )
getAllFilesAndFolders(s,baseRoot,ref table);
string[] files = Directory.GetFiles(path);
foreach(string pkgFile in files)
{
row = table.NewRow();
row["File_Name"] = pkgFile.Replace(baseRoot,"");
table.Rows.Add(row);
}
}
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?