版本发布:

一、局域网共享文件方式

 

发布界面:

更新界面:

 

二、FTP方式

发布界面

更新界面:

 

 

(只会更新有变动的文件)
同步新增,替换与删除
实现方式XML(文件名+文件最后修改时间)
状态判断:LINQ(通过对比本地XML和服务器XML的不同)

 

XML实质是一张DataSet

包含两张表

#region 获得数据集结构
/// <summary>
/// 获得数据集结构
/// </summary>
/// <returns></returns>
protected DataSet GenerateDataSchema()
{
DataTable dtV = new DataTable(DataSchema.VersionSchema.TableName);
dtV.Columns.Add(DataSchema.VersionSchema.Version); DataTable dtD = new DataTable(DataSchema.DetailSchema.TableName);
dtD.Columns.Add(DataSchema.DetailSchema.Name, typeof(System.String));//名称
dtD.Columns.Add(DataSchema.DetailSchema.EditDate, typeof(System.DateTime));//修改时间
dtD.Columns.Add(DataSchema.DetailSchema.Size, typeof(System.String));//大小
dtD.Columns.Add(DataSchema.DetailSchema.Path, typeof(System.String));//路径 DataSet ds = new DataSet(); ds.Tables.Add(dtV);
ds.Tables.Add(dtD); return ds;
}
#endregion

 

LINQ服务器和本地对比代码:

版本发布:

//需要新增的
//需要删除的
//需要替换的 var DataEdit = from dtLocation in LocalDetailFiles.AsEnumerable()
join dtServer in ServerDetailFiles.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)
where dtLocation.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)
};
var DataAdd = from dtLocal in LocalDetailFiles.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)
};
var DataDelete = from dtServer in ServerDetailFiles.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 = new DataTable();
dtUpdateFiles.Columns.Add("Name", typeof(System.String));
dtUpdateFiles.Columns.Add("Path", typeof(System.String));
dtUpdateFiles.Columns.Add("Type", typeof(System.String)); foreach (var v in DataAdd)
{
DataRow dr = dtUpdateFiles.Rows.Add();
dr["Type"] = "1";
dr["Name"] = v.Name;
dr["Path"] = v.Path; //ListViewItem item = new ListViewItem("新增");
//item.SubItems.Add(v.Name);//文件名
//item.SubItems.Add(v.Path);//路径
//LVFile.Items.Add(item);
}
foreach (var v in DataEdit)
{
DataRow dr = dtUpdateFiles.Rows.Add();
dr["Type"] = "2";
dr["Name"] = v.Name;
dr["Path"] = v.Path; //ListViewItem item = new ListViewItem("替换");
//item.SubItems.Add(v.Name);//文件名
//item.SubItems.Add(v.Path);//路径
//LVFile.Items.Add(item);
}
foreach (var v in DataDelete)
{
DataRow dr = dtUpdateFiles.Rows.Add();
dr["Type"] = "3";
dr["Name"] = v.Name;
dr["Path"] = v.Path; //ListViewItem item = new ListViewItem("删除");
//item.SubItems.Add(v.Name);//文件名
//item.SubItems.Add(v.Path);//路径
//LVFile.Items.Add(item);
}

版本更新:

//需要新增的
//需要删除的
//需要替换的 var DataEdit = from dtServer in ServerDetailFiles.AsEnumerable()
join dtLocation in LocalDetailFiles.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)
where dtServer.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)
};
var DataAdd = from dtServer in ServerDetailFiles.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)
};
var DataDelete = from dtLocation in LocalDetailFiles.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版本发布更新的更多相关文章

  1. winform版本自动更新

    我们在使用软件的时候经常会遇到升级版本,这也是Winform程序的一个功能,今天就大概说下我是怎么实现的吧(代码有点不完美有小BUG,后面再说) 先说下我的思路:首先在打开程序的时候去拿到我之前在网站 ...

  2. Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):5、Maven版本发布与后续版本更新(大结局)

    文章目录: Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):1.JIRA账号注册 Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):2.PGP ...

  3. RDIFramework.NET平台代码生成器V3.0版本全新发布-更新于20160518(提供下载)

    最新版本请转到:RDIFramework.NET平台代码生成器V3.1版本全新发布-更新于2016-10-08(提供下载) RDIFramework.NET代码生成器V3.0版本修改了针对3.0版本的 ...

  4. go-wingui 2018 全新 v2.0 版本发布,包含重大更新!

    go-wingui 2018 全新 v2.0 版本发布,包含重大更新!使用新版CEF内核Chromium 63.0.3239.109,页面可以使用最新的css3,html5技术.使用delphi7重写 ...

  5. 自动化部署与统一安装升级 - 类ansible工具 udeploy0.3版本发布 (更新时间2014-12-24)

    下载地址:  unifyDeploy0.1版本  unifyDeploy0.2版本     unifyDeploy0.3版本 (更新时间2014-07-25)   自动化部署与统一安装升级,适用于多资 ...

  6. JeeWx全新版本发布!捷微二代微信活动平台1.0发布!活动插件持续开源更新!

    JeeWx捷微二代微信活动平台 (专业微信营销活动平台,活动插件持续更新ing~)    终于等到你!还好我没放弃! 在团队持续多年的努力下,Jeewx微信管家和H5活动平台不断更新迭代,积累了许许多 ...

  7. RDIFramework.NET ━ .NET快速信息化系统开发框架 V2.8 版本发布

    (新年巨献) RDIFramework.NET ━ .NET快速信息化系统开发框架 V2.8 版本发布 历时数月,RDIFramework.NET V2.8版本发布了,感谢大家的支持. RDIFram ...

  8. RDIFramework.NET ━ .NET快速信息化系统开发框架 V2.7 版本发布

    历时数月,RDIFramework.NET V2.7 版本发布了,感谢大家的支持. RDIFramework.NET,基于.NET的快速信息化系统开发.整合框架,为企业或个人在.NET环境下快速开发系 ...

  9. EQueue 2.3.2版本发布(支持高可用)

    前言 前段时间针对EQueue的完善终于告一段落了,实在值得庆祝,自己的付出和坚持总算有了成果.这次新版本主要为EQueue实现了集群功能,基本实现了Broker的高可用.另外还增加了很多实用的功能, ...

随机推荐

  1. php基础知识和函数

    <?php /* echo "hello","aaaa"; //输出语法,可以输出多个字符串 print "world"; //可以输 ...

  2. linux 压缩文件的命令总结

    Linux压缩文件的读取 *.Z       compress 程序压缩的档案: *.bz2     bzip2 程序压缩的档案: *.gz      gzip 程序压缩的档案: *.tar     ...

  3. yii2验证码的使用

    1.控制器中 public function actions()     {         return [             'captcha' => [               ...

  4. 【GDI+】一些规则多边形分离的问题

    在近期的工作中,需要做一样工作:将一些有规则的图形,进行适当的分离,以达到不重叠的问题. 首先组成图形的点都可以是按照逆时针排好序的. 规则的图形可以大致分为三类: A :两个点组成的线 或者 四个点 ...

  5. 集成Spring事物管理

    什么是事物 事物是访问数据库的一个操作序列,数据库应用系统通过事物集来完成对数据库的存取.事物的正确执行使得数据库从一种状态转换为另一种状态. 事物必须服从ISO/IEC所制定的ACID原则.ACID ...

  6. SlidingMenu实现app侧滑功能

    很多APP都有侧滑菜单的功能,部分APP左右都是侧滑菜单~SlidingMenu 这个开源项目可以很好帮助我们实现侧滑功能,如果对SlidingMenu 还不是很了解的童鞋,可以参考下本篇博客. 本片 ...

  7. UIActionSheet和UIAlert

    UIActionSheet: 首先,在.h文件中添加Protocol,(Protocol相当于Java中的interface) @interface ActionSheetViewController ...

  8. mysql字符串相关

    使用MySQL,我们很多时候都会出现需要截取字符串的情况,所以关于字符串的截取的方式有必要记录下去. MySQL截取字符串的函数有: left(str, length):从左边开始截取,length是 ...

  9. zabbix如何实现微信报警 转载

    现实生产环境中,我们通常使用邮件和短信接受zabbix报警信息,但是邮件经常被工作人员搁置在角落中甚至被设置为垃圾邮件被过滤掉.公司的短信接口又太贵,复杂环境中使用短息报警会使运维成本增加很多.微信提 ...

  10. android listview万能适配器

    参考    Android 快速开发系列 打造万能的ListView GridView 适配器 Hongyang public class CommonViewHolder { private Con ...