WinForm Version Release update

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.