版本发布:

一、局域网共享文件方式

 

发布界面:

更新界面:

 

二、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. 使用sudo执行命令的时候提示找不到命令

    事出有因, 源自使用源码编译 nginx , 在 /usr/local/sbin/ 目录下创建了nginx 启动的符号链接 , 执行 sudo nginx 的时候提示找不到命令, 但是使用普通用户身份 ...

  2. 【sinatra】设置默认的端口

    加入 set :port, 8888 #默认4567

  3. 【RoR win32】新rails运行后0.0.0.0:3000不能访问

    在浏览器中使用127.0.0.1:3000来访问

  4. 六、Java基础---------equals 与 ==深入讲解

    在我们写程序时经常会去比较两个变量是否相等,一般我们有两种方式去比较:equals与==,但是很多情况是不明就里,最后得出错误的结论.本文详解了equals与==. Java程序中测试两个变量是否的两 ...

  5. jquery通过name属性取值的方法

    jquery通过name属性取值的方法//$("input[name='imgtitle']").val();//这个只能取到第一个的值//通过each函数取得所有input的值v ...

  6. org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.servlet.Servlet

    java.lang.ClassCastException: org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.se ...

  7. 图示-Centos7完整安装

    工作过程中,一些未接触过Centos,或未安装过Centos的同事经常会问,如何安装?这个事说简单真简单,只有操作过一次,第二次就能够熟练的自己动手安装:但说难也难,如果没人带,第一次安装的时候确实不 ...

  8. HDU 5724:Chess(博弈 + 状压)

    http://acm.hdu.edu.cn/showproblem.php?pid=5724 Chess Problem Description   Alice and Bob are playing ...

  9. python:正则表达式 re

    #re正则的用法:match匹配从开头 search 取一个就回来了,findout取所以匹配的,slit分割 sub替换 #-*- coding:utf8 -*- # Auth:fulimei #r ...

  10. 【转】SVN提示:由于目标机器积极拒绝,无法连接 的解决方法

    转载地址:http://wxiaolei.blog.163.com/blog/static/1038760120133108180596/ 安装完TSVN之后,checkout时报错,并且后来在cmd ...