Version released:
One, LAN shared file mode
Publishing interface:
Update interface:
Second, the FTP mode
Publishing interface
Update interface:
(only changed files are updated)
Sync new, replace and delete
Implementation mode XML (file name + file last modified time)
State judgment: LINQ (by comparing the differences between local XML and server XML)
XML is essentially a dataset
Contains two tables
#regionGet the data set structure/// <summary> ///get the data set structure/// </summary> /// <returns></returns> protectedDataSet Generatedataschema () {DataTable DtV=NewDataTable (DataSchema.VersionSchema.TableName); DTV.COLUMNS.ADD (DataSchema.VersionSchema.Version); DataTable DtD=NewDataTable (DataSchema.DetailSchema.TableName); DTD.COLUMNS.ADD (DataSchema.DetailSchema.Name,typeof(System.String));//nameDTD.COLUMNS.ADD (DataSchema.DetailSchema.EditDate,typeof(System.DateTime));//Modification TimeDTD.COLUMNS.ADD (DataSchema.DetailSchema.Size,typeof(System.String));//sizeDTD.COLUMNS.ADD (DataSchema.DetailSchema.Path,typeof(System.String));//PathDataSet DS=NewDataSet (); Ds. Tables.add (DtV); Ds. Tables.add (DtD); returnds; } #endregion
LINQ server and local Contrast code:
Version released:
//need to add a new//you need to delete the//you need to replace the varDataedit = fromDtlocationinchlocaldetailfiles.asenumerable () join Dtserverinchserverdetailfiles.asenumerable () on Dtlocation.field<string> (DataSchema.DetailSchema.Path) + dtlocation.field<string>(DataSchema.DetailSchema.Name) equals Dtserver.field<string> (DataSchema.DetailSchema.Path) + dtserver.field<string>(DataSchema.DetailSchema.Name)whereDtlocation.field<datetime> (DataSchema.DetailSchema.EditDate) > Dtserver.field<datetime>(DataSchema.DetailSchema.EditDate)Select New{Name= dtlocation.field<string>(DataSchema.DetailSchema.Name), Path= dtlocation.field<string>(DataSchema.DetailSchema.Path)}; varDataadd = fromDtlocalinchlocaldetailfiles.asenumerable ()where! Serverdetailfiles.asenumerable (). Any (y = y.field<string> (DataSchema.DetailSchema.Path) + y.field<string> (DataSchema.DetailSchema.Name) = = dtlocal.field<string> (DataSchema.DetailSchema.Path) + dtlocal.field<string>(DataSchema.DetailSchema.Name))Select New{Name= dtlocal.field<string>(DataSchema.DetailSchema.Name), Path= dtlocal.field<string>(DataSchema.DetailSchema.Path)}; varDatadelete = fromDtserverinchserverdetailfiles.asenumerable ()where! Localdetailfiles.asenumerable (). Any (y = y.field<string> (DataSchema.DetailSchema.Path) + y.field<string> (DataSchema.DetailSchema.Name) = = dtserver.field<string> (DataSchema.DetailSchema.Path) + dtserver.field<string>(DataSchema.DetailSchema.Name))Select New{Name= dtserver.field<string>(DataSchema.DetailSchema.Name), Path= dtserver.field<string>(DataSchema.DetailSchema.Path)}; Dtupdatefiles=NewDataTable (); DTUPDATEFILES.COLUMNS.ADD ("Name",typeof(System.String)); DTUPDATEFILES.COLUMNS.ADD ("Path",typeof(System.String)); DTUPDATEFILES.COLUMNS.ADD ("Type",typeof(System.String)); foreach(varVinchdataadd) {DataRow Dr=DtUpdateFiles.Rows.Add (); dr["Type"] ="1"; dr["Name"] =V.name; dr["Path"] =V.path; //ListViewItem item = new ListViewItem ("new"); //item. SubItems.Add (v.name);//file name//item. SubItems.Add (V.path);//Path//LVFILE.ITEMS.ADD (item); } foreach(varVinchDataedit) {DataRow Dr=DtUpdateFiles.Rows.Add (); dr["Type"] ="2"; dr["Name"] =V.name; dr["Path"] =V.path; //ListViewItem item = new ListViewItem ("Replace"); //item. SubItems.Add (v.name);//file name//item. SubItems.Add (V.path);//Path//LVFILE.ITEMS.ADD (item); } foreach(varVinchdatadelete) {DataRow Dr=DtUpdateFiles.Rows.Add (); dr["Type"] ="3"; dr["Name"] =V.name; dr["Path"] =V.path; //ListViewItem item = new ListViewItem ("delete"); //item. SubItems.Add (v.name);//file name//item. SubItems.Add (V.path);//Path//LVFILE.ITEMS.ADD (item);}
Version update:
//need to add a new//you need to delete the//you need to replace the varDataedit = fromDtserverinchserverdetailfiles.asenumerable () join Dtlocationinchlocaldetailfiles.asenumerable () on Dtserver.field<string> (DataSchema.DetailSchema.Path) + dtserver.field<string>(DataSchema.DetailSchema.Name) equals Dtlocation.field<string> (DataSchema.DetailSchema.Path) + dtlocation.field<string>(DataSchema.DetailSchema.Name)whereDtserver.field<datetime> (DataSchema.DetailSchema.EditDate) > Dtlocation.field<datetime>(DataSchema.DetailSchema.EditDate)Select New{Name= dtserver.field<string>(DataSchema.DetailSchema.Name), Path= dtserver.field<string>(DataSchema.DetailSchema.Path)}; varDataadd = fromDtserverinchserverdetailfiles.asenumerable ()where! Localdetailfiles.asenumerable (). Any (y = y.field<string> (DataSchema.DetailSchema.Path) + y.field<string> (DataSchema.DetailSchema.Name) = = dtserver.field<string> (DataSchema.DetailSchema.Path) + dtserver.field<string>(DataSchema.DetailSchema.Name))Select New{Name= dtserver.field<string>(DataSchema.DetailSchema.Name), Path= dtserver.field<string>(DataSchema.DetailSchema.Path)}; varDatadelete = fromDtlocationinchlocaldetailfiles.asenumerable ()where! Serverdetailfiles.asenumerable (). Any (y = y.field<string> (DataSchema.DetailSchema.Path) + y.field<string> (DataSchema.DetailSchema.Name) = = dtlocation.field<string> (DataSchema.DetailSchema.Path) + dtlocation.field<string>(DataSchema.DetailSchema.Name))Select New{Name= dtlocation.field<string>(DataSchema.DetailSchema.Name), Path= dtlocation.field<string>(DataSchema.DetailSchema.Path)};
WinForm Version Release update