first version

master
ZhangZhen 张镇 5 years ago
parent 4a7bbc470f
commit e6a528f67d

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>20108e89-f727-4d06-8bcc-72fe15732c19</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Midea.Mes.Common</RootNamespace>
<AssemblyName>Midea.Mes.Common</AssemblyName>
<ProjectGuid>{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Midea.MES.Update.Test</RootNamespace>
<AssemblyName>Midea.MES.Update.Test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@ -23,6 +23,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
@ -31,24 +32,21 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="Microsoft.CSharp"/>
<Reference Include="System.Data"/>
<Reference Include="System.Net.Http"/>
<Reference Include="System.Xml"/>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Xml;
namespace Midea.MES.Update.Test
{
class Program
{
static void Main(string[] args)
{
//测试类
#region 测试XML文件的生成
//string url = "www.baidu.com";
//string num = "1.0.0.1";
//string date = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd hh:mi:ss"));
//XmlDocument xd = new XmlDocument();
//XmlDeclaration xmlDeclaration=xd.CreateXmlDeclaration("1.0", "utf-8", "");
//xd.AppendChild(xmlDeclaration);
//XmlElement root=xd.CreateElement("AutoUpdater");
//xd.AppendChild(root);
//XmlElement urlElement = xd.CreateElement("URLAddress");
//urlElement.SetAttribute("URL", url);
//XmlElement updateElement = xd.CreateElement("UpdateInfo");
//XmlElement versionElement = xd.CreateElement("Version");
//versionElement.SetAttribute("Num", num);
//XmlElement updateTimeElement = xd.CreateElement("UpdateTime");
//updateTimeElement.SetAttribute("Date", date);
//updateElement.AppendChild(versionElement);
//updateElement.AppendChild(updateTimeElement);
//XmlElement updateFileListEle = xd.CreateElement("UpdateFileList");
//root.AppendChild(updateFileListEle);
//root.AppendChild(urlElement);
//root.AppendChild(updateElement);
//xd.Save("test.xml");
#endregion
#region 测试文件
//string dir = @"D:\workfile\运维小分队";
//var files=new List<string>();
//GetFiles(dir,files);
//var fileModels = new List<FileModel>();
//foreach(var t in files)
//{
// var fileInfo = new FileInfo(t);
// fileModels.Add(new FileModel()
// {
// Ext = fileInfo.Extension,
// Name = fileInfo.Name,
// RelativeDir = fileInfo.DirectoryName.Replace(dir, ""),
// LastModifyTime=fileInfo.LastWriteTime,
// Lenght=fileInfo.Length
// });
// ;
//}
//foreach(var file in fileModels)
//{
// Console.WriteLine($"{file.Name} {file.Ext} {file.LastModifyTime} {file.RelativeDir}");
//}
#endregion
#region 测试文件的创建
FileStream fileStream = new FileStream("test/zhangzhen.txt", FileMode.OpenOrCreate);
var str = "我是中国人";
fileStream.Write(Encoding.UTF8.GetBytes(str),0,str.Length);
#endregion
fileStream.Close();
Console.ReadKey();
}
static void GetFiles(string rootDir,List<string> files)
{
var dirs=Directory.GetDirectories(rootDir);
foreach (var dir in dirs)
{
GetFiles(dir, files);
}
files.AddRange(Directory.GetFiles(rootDir));
}
}
public class FileModel {
public string Name { get; set; }
public string Ext { get; set; }
public DateTime LastModifyTime { get; set; }
public string RelativeDir { get; set; }
public long Lenght { get; set; }
}
}

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Midea.Mes.Common")]
[assembly: AssemblyTitle("Midea.MES.Update.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Midea.Mes.Common")]
[assembly: AssemblyProduct("Midea.MES.Update.Test")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("20108e89-f727-4d06-8bcc-72fe15732c19")]
[assembly: Guid("fb78b044-b526-425a-aca7-a6f1aaaabfbf")]
// 程序集的版本信息由下列四个值组成:
//

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoUpdater>
<URLAddress URL="www.baidu.com" />
<UpdateInfo Date="2020-03-17 02:50i:37">
<Version Num="1.0.0.1" />
<UpdateTime />
</UpdateInfo>
</AutoUpdater>

@ -0,0 +1,6 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\bin\Debug\Midea.MES.Update.Test.exe.config
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\bin\Debug\Midea.MES.Update.Test.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\bin\Debug\Midea.MES.Update.Test.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\obj\Debug\Midea.MES.Update.Test.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\obj\Debug\Midea.MES.Update.Test.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.MES.Update.Test\obj\Debug\Midea.MES.Update.Test.csprojAssemblyReference.cache

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Midea.Mes.BLL
{
public class Class1
{
}
}

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>f774025a-f9be-4585-b362-adebc5b58cbb</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Midea.Mes.BLL</RootNamespace>
<AssemblyName>Midea.Mes.BLL</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="Microsoft.CSharp"/>
<Reference Include="System.Data"/>
<Reference Include="System.Net.Http"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Midea.Mes.BLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Midea.Mes.BLL")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f774025a-f9be-4585-b362-adebc5b58cbb")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -1,4 +0,0 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.BLL\bin\Debug\Midea.Mes.BLL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.BLL\bin\Debug\Midea.Mes.BLL.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.BLL\obj\Debug\Midea.Mes.BLL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.BLL\obj\Debug\Midea.Mes.BLL.pdb

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Midea.Mes.Common
{
public class Class1
{
}
}

@ -1,5 +0,0 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Common\bin\Debug\Midea.Mes.Common.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Common\bin\Debug\Midea.Mes.Common.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Common\obj\Debug\Midea.Mes.Common.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Common\obj\Debug\Midea.Mes.Common.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Common\obj\Debug\Midea.Mes.Common.csprojAssemblyReference.cache

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Midea.Mes.DAL
{
public class Class1
{
}
}

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>e511d19f-be15-4d50-b81c-3b1bf946a75f</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Midea.Mes.DAL</RootNamespace>
<AssemblyName>Midea.Mes.DAL</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="Microsoft.CSharp"/>
<Reference Include="System.Data"/>
<Reference Include="System.Net.Http"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Midea.Mes.DAL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Midea.Mes.DAL")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e511d19f-be15-4d50-b81c-3b1bf946a75f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -1,4 +0,0 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.DAL\bin\Debug\Midea.Mes.DAL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.DAL\bin\Debug\Midea.Mes.DAL.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.DAL\obj\Debug\Midea.Mes.DAL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.DAL\obj\Debug\Midea.Mes.DAL.pdb

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<AutoUpdater>
<URLAddress URL="http://127.0.0.1/Download"></URLAddress>
<UpdateInfo>
<Version num="1.0.0.1"></Version>
<UpdateTime date="2017-01-22"></UpdateTime>
</UpdateInfo>
<UpdateFileList>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen1.txt" ContentLength="1024"></UpdateFile>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen2.txt" ContentLength="1024"></UpdateFile>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen3.txt" ContentLength="1024"></UpdateFile>
</UpdateFileList>
</AutoUpdater>

@ -36,6 +36,8 @@
this.SystemMenu = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkUpdateMenu = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.V10ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@ -55,6 +57,9 @@
//
// 生产ToolStripMenuItem
//
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.V10ToolStripMenuItem});
this.ToolStripMenuItem.Name = "生产ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
this.ToolStripMenuItem.Text = "生产";
@ -99,6 +104,18 @@
this.checkUpdateMenu.Text = "系统更新";
this.checkUpdateMenu.Click += new System.EventHandler(this.checkUpdateMenu_Click);
//
// 生产标签打印ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "生产标签打印ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "生产标签打印";
//
// 生产标签打印V10ToolStripMenuItem
//
this.V10ToolStripMenuItem.Name = "生产标签打印V10ToolStripMenuItem";
this.V10ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.V10ToolStripMenuItem.Text = "生产标签打印V1.0";
//
// MainFrm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -125,6 +142,8 @@
private System.Windows.Forms.ToolStripMenuItem SystemMenu;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem checkUpdateMenu;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem V10ToolStripMenuItem;
}
}

@ -79,27 +79,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Midea.Mes.BLL\Midea.Mes.BLL.csproj">
<Project>{f774025a-f9be-4585-b362-adebc5b58cbb}</Project>
<Name>Midea.Mes.BLL</Name>
</ProjectReference>
<ProjectReference Include="..\Midea.Mes.Common\Midea.Mes.Common.csproj">
<Project>{20108e89-f727-4d06-8bcc-72fe15732c19}</Project>
<Name>Midea.Mes.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Midea.Mes.DAL\Midea.Mes.DAL.csproj">
<Project>{e511d19f-be15-4d50-b81c-3b1bf946a75f}</Project>
<Name>Midea.Mes.DAL</Name>
</ProjectReference>
<ProjectReference Include="..\Midea.Mes.Update\Midea.Mes.Update.csproj">
<Project>{ae848395-70f7-4517-a1d2-26c03803f832}</Project>
<Name>Midea.Mes.Update</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Config\UpdateList.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<AutoUpdater>
<URLAddress URL="http://127.0.0.1/Download"></URLAddress>
<UpdateInfo>
<Version num="1.0.0.1"></Version>
<UpdateTime date="2017-01-22"></UpdateTime>
</UpdateInfo>
<UpdateFileList>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen1.txt" ContentLength="1024"></UpdateFile>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen2.txt" ContentLength="1024"></UpdateFile>
<UpdateFile Ver="1.0.0.1" FileName="zhangzhen3.txt" ContentLength="1024"></UpdateFile>
</UpdateFileList>
</AutoUpdater>

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<AutoUpdater>
<URLAddress URL="http://172.28.13.250:9000/" />
<UpdateInfo>
<Version Num="1.0.0.1"/>
<UpdateTime Date="2017-01-22"/>
</UpdateInfo>
<UpdateFileList>
<UpdateFile Ver="1.0.0.1" FileName="1.txt" ContentLength="1024"/>
<UpdateFile Ver="1.0.0.1" FileName="2.txt" ContentLength="1024"/>
<UpdateFile Ver="1.0.0.1" FileName="3.docx" ContentLength="1024"/>
<UpdateFile Ver="1.0.0.1" FileName="4.docx" ContentLength="1024"/>
</UpdateFileList>
</AutoUpdater>

@ -1,13 +1,7 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Frm.exe.config
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Frm.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Frm.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.BLL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Common.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.DAL.dll
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Update.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.BLL.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Common.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.DAL.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Update.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Midea.Mes.Update.exe.config
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\obj\Debug\Midea.Mes.Frm.csprojAssemblyReference.cache
@ -17,4 +11,3 @@ D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\obj\Debu
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\obj\Debug\Midea.Mes.Frm.csproj.CopyComplete
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\obj\Debug\Midea.Mes.Frm.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\obj\Debug\Midea.Mes.Frm.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Frm\bin\Debug\Config\UpdateList.xml

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<!--检查哪个目录的文件或者文件夹-->
<add key="SearchDir" value="D:\\other\\csharpCode\\Winform-AutoUpdate\\Winform-AutoUpdate\\Midea.Mes.Frm\\bin\\Debug"/>
<!--抽取当前时间提前多少天文件出来发布-->
<add key="AddvancedDay" value="10"/>
<!--忽略的文件夹-->
<add key="IgnoredDir" value=""/>
<!--忽略的文件-->
<add key="IgnoredFile" value=""/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

@ -28,13 +28,36 @@
/// </summary>
private void InitializeComponent()
{
this.btnGenerate = new System.Windows.Forms.Button();
this.btnPublishTest = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnGenerate
//
this.btnGenerate.Location = new System.Drawing.Point(13, 13);
this.btnGenerate.Name = "btnGenerate";
this.btnGenerate.Size = new System.Drawing.Size(119, 27);
this.btnGenerate.TabIndex = 0;
this.btnGenerate.Text = "生成更新文件";
this.btnGenerate.UseVisualStyleBackColor = true;
this.btnGenerate.Click += new System.EventHandler(this.btnGenerate_Click);
//
// btnPublishTest
//
this.btnPublishTest.Location = new System.Drawing.Point(180, 13);
this.btnPublishTest.Name = "btnPublishTest";
this.btnPublishTest.Size = new System.Drawing.Size(126, 27);
this.btnPublishTest.TabIndex = 1;
this.btnPublishTest.Text = "一键部署到测试环境";
this.btnPublishTest.UseVisualStyleBackColor = true;
//
// GenerateFrm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.btnPublishTest);
this.Controls.Add(this.btnGenerate);
this.Name = "GenerateFrm";
this.Text = "更新文件生成程序";
this.ResumeLayout(false);
@ -42,6 +65,9 @@
}
#endregion
private System.Windows.Forms.Button btnGenerate;
private System.Windows.Forms.Button btnPublishTest;
}
}

@ -7,6 +7,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Configuration;
using System.Xml;
namespace Midea.Mes.Generate
{
@ -16,5 +19,103 @@ namespace Midea.Mes.Generate
{
InitializeComponent();
}
private void btnGenerate_Click(object sender, EventArgs e)
{
//从指定目录下读取出文件。
var rootDir = ConfigurationManager.AppSettings["SearchDir"];
var ignoredDir = ConfigurationManager.AppSettings["IgnoredDir"];
var AdancedDay = ConfigurationManager.AppSettings["AddvancedDay"];
string version = "1.0.0.1";
string url = "http://192.168.232.1:8090/";
string num = "1.0.0.1";
string date = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
var updateFiles = GetUpdateFileModels(rootDir, version);
//去除包含pdb文件
updateFiles = updateFiles.Where(d => !d.Name.Contains("pdb")&&!d.Name.Contains("Update")).ToList();
//然后根据需要做一些筛选。
//生成XML文件
BuildXMLFile(updateFiles, url, num, date);
}
private void BuildXMLFile(List<UpdateFileModel> updateFiles,string url,string num,string date)
{
//用DOM的方式来操作XML。
if (File.Exists("UpdateList.xml"))
{
File.Delete("UpdateList.xml");
}
XmlDocument xd = new XmlDocument();
XmlDeclaration xmlDeclaration = xd.CreateXmlDeclaration("1.0", "utf-8", "");
xd.AppendChild(xmlDeclaration);
XmlElement root = xd.CreateElement("AutoUpdater");
xd.AppendChild(root);
XmlElement urlElement = xd.CreateElement("URLAddress");
urlElement.SetAttribute("URL", url);
XmlElement updateElement = xd.CreateElement("UpdateInfo");
XmlElement versionElement = xd.CreateElement("Version");
versionElement.SetAttribute("Num", num);
XmlElement updateTimeElement = xd.CreateElement("UpdateTime");
updateTimeElement.SetAttribute("Date", date);
updateElement.AppendChild(versionElement);
updateElement.AppendChild(updateTimeElement);
XmlElement updateFileListEle = xd.CreateElement("UpdateFileList");
foreach(var file in updateFiles)
{
XmlElement updateFileEle = xd.CreateElement("UpdateFile");
updateFileEle.SetAttribute("Ver",file.Version);
updateFileEle.SetAttribute("FileName",file.Name);
updateFileEle.SetAttribute("ContentLength",file.Lenght.ToString());
updateFileListEle.AppendChild(updateFileEle);
}
root.AppendChild(updateFileListEle);
root.AppendChild(urlElement);
root.AppendChild(updateElement);
xd.Save("UpdateList.xml");
}
private List<UpdateFileModel> GetUpdateFileModels(string rootDir,string version)
{
var result = new List<UpdateFileModel>();
var filePaths = new List<string>();
GetFiles(rootDir, filePaths);
var fileModels = new List<UpdateFileModel>();
foreach (var t in filePaths)
{
var fileInfo = new FileInfo(t);
result.Add(new UpdateFileModel()
{
Ext = fileInfo.Extension,
Name = fileInfo.Name,
RelativeDir = fileInfo.DirectoryName.Replace(rootDir, ""),
LastModifyTime = fileInfo.LastWriteTime,
Lenght = fileInfo.Length,
Version= version
});
}
return result;
}
private void GetFiles(string rootDir, List<string> files)
{
var dirs = Directory.GetDirectories(rootDir);
foreach (var dir in dirs)
{
GetFiles(dir, files);
}
files.AddRange(Directory.GetFiles(rootDir));
}
}
}

@ -33,6 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@ -53,6 +54,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UpdateModel.cs" />
<EmbeddedResource Include="GenerateFrm.resx">
<DependentUpon>GenerateFrm.cs</DependentUpon>
</EmbeddedResource>

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Midea.Mes.Generate
{
public class UpdateFileModel
{
public string Name { get; set; }
public string Ext { get; set; }
public DateTime LastModifyTime { get; set; }
public string RelativeDir { get; set; }
public long Lenght { get; set; }
public string Version { get; set; }
}
}

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--检查哪个目录的文件或者文件夹-->
<add key="SearchDir" value="D:\\other\\csharpCode\\Winform-AutoUpdate\\Winform-AutoUpdate\\Midea.Mes.Frm\\bin\\Debug"/>
<!--抽取当前时间提前多少天文件出来发布-->
<add key="AddvancedDay" value="10"/>
<!--忽略的文件夹-->
<add key="IgnoredDir" value=""/>
<!--忽略的文件-->
<add key="IgnoredFile" value=""/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoUpdater>
<UpdateFileList>
<UpdateFile Ver="1.0.0.1" FileName="Midea.Mes.Frm.exe" ContentLength="10240" />
<UpdateFile Ver="1.0.0.1" FileName="Midea.Mes.Frm.exe.config" ContentLength="187" />
</UpdateFileList>
<URLAddress URL="http://192.168.232.1:8090/" />
<UpdateInfo>
<Version Num="1.0.0.1" />
<UpdateTime Date="2020-03-17 07:50:43" />
</UpdateInfo>
</AutoUpdater>

@ -0,0 +1,8 @@
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\bin\Debug\Midea.Mes.Generate.exe.config
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\bin\Debug\Midea.Mes.Generate.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\bin\Debug\Midea.Mes.Generate.pdb
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\obj\Debug\Midea.Mes.Generate.GenerateFrm.resources
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\obj\Debug\Midea.Mes.Generate.Properties.Resources.resources
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\obj\Debug\Midea.Mes.Generate.csproj.GenerateResource.cache
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\obj\Debug\Midea.Mes.Generate.exe
D:\other\csharpCode\Winform-AutoUpdate\Winform-AutoUpdate\Midea.Mes.Generate\obj\Debug\Midea.Mes.Generate.pdb

@ -3,36 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.DAL", "Midea.Mes.DAL\Midea.Mes.DAL.csproj", "{E511D19F-BE15-4D50-B81C-3B1BF946A75F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.Common", "Midea.Mes.Common\Midea.Mes.Common.csproj", "{20108E89-F727-4D06-8BCC-72FE15732C19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.BLL", "Midea.Mes.BLL\Midea.Mes.BLL.csproj", "{F774025A-F9BE-4585-B362-ADEBC5B58CBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.Frm", "Midea.Mes.Frm\Midea.Mes.Frm.csproj", "{3D1974D0-48D2-4979-8805-C441D4B9EF06}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.Update", "Midea.Mes.Update\Midea.Mes.Update.csproj", "{AE848395-70F7-4517-A1D2-26C03803F832}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.Mes.Generate", "Midea.Mes.Generate\Midea.Mes.Generate.csproj", "{3CE6283C-DFDA-404E-A281-DAB3E2094C04}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Midea.MES.Update.Test", "Midea.MES.Update.Test\Midea.MES.Update.Test.csproj", "{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E511D19F-BE15-4D50-B81C-3B1BF946A75F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E511D19F-BE15-4D50-B81C-3B1BF946A75F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E511D19F-BE15-4D50-B81C-3B1BF946A75F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E511D19F-BE15-4D50-B81C-3B1BF946A75F}.Release|Any CPU.Build.0 = Release|Any CPU
{20108E89-F727-4D06-8BCC-72FE15732C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20108E89-F727-4D06-8BCC-72FE15732C19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20108E89-F727-4D06-8BCC-72FE15732C19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20108E89-F727-4D06-8BCC-72FE15732C19}.Release|Any CPU.Build.0 = Release|Any CPU
{F774025A-F9BE-4585-B362-ADEBC5B58CBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F774025A-F9BE-4585-B362-ADEBC5B58CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F774025A-F9BE-4585-B362-ADEBC5B58CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F774025A-F9BE-4585-B362-ADEBC5B58CBB}.Release|Any CPU.Build.0 = Release|Any CPU
{3D1974D0-48D2-4979-8805-C441D4B9EF06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D1974D0-48D2-4979-8805-C441D4B9EF06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D1974D0-48D2-4979-8805-C441D4B9EF06}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -45,6 +29,10 @@ Global
{3CE6283C-DFDA-404E-A281-DAB3E2094C04}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CE6283C-DFDA-404E-A281-DAB3E2094C04}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CE6283C-DFDA-404E-A281-DAB3E2094C04}.Release|Any CPU.Build.0 = Release|Any CPU
{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB78B044-B526-425A-ACA7-A6F1AAAABFBF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save