| @ -0,0 +1,86 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <Project ToolsVersion="12.0" DefaultTargets="Build" 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>{9F9BF3C4-A866-4E80-A0CB-1255ADE91428}</ProjectGuid> | |||||
| <OutputType>WinExe</OutputType> | |||||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||||
| <RootNamespace>ButcherFactory.AutoUpdate</RootNamespace> | |||||
| <AssemblyName>ButcherFactory.AutoUpdate</AssemblyName> | |||||
| <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |||||
| <FileAlignment>512</FileAlignment> | |||||
| </PropertyGroup> | |||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| <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' "> | |||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| <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.Deployment" /> | |||||
| <Reference Include="System.Drawing" /> | |||||
| <Reference Include="System.Windows.Forms" /> | |||||
| <Reference Include="System.Xml" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <Compile Include="ClientVersion.cs" /> | |||||
| <Compile Include="Form1.cs"> | |||||
| <SubType>Form</SubType> | |||||
| </Compile> | |||||
| <Compile Include="Form1.Designer.cs"> | |||||
| <DependentUpon>Form1.cs</DependentUpon> | |||||
| </Compile> | |||||
| <Compile Include="Program.cs" /> | |||||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||||
| <EmbeddedResource Include="Form1.resx"> | |||||
| <DependentUpon>Form1.cs</DependentUpon> | |||||
| </EmbeddedResource> | |||||
| <EmbeddedResource Include="Properties\Resources.resx"> | |||||
| <Generator>ResXFileCodeGenerator</Generator> | |||||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | |||||
| <SubType>Designer</SubType> | |||||
| </EmbeddedResource> | |||||
| <Compile Include="Properties\Resources.Designer.cs"> | |||||
| <AutoGen>True</AutoGen> | |||||
| <DependentUpon>Resources.resx</DependentUpon> | |||||
| </Compile> | |||||
| <None Include="Properties\Settings.settings"> | |||||
| <Generator>SettingsSingleFileGenerator</Generator> | |||||
| <LastGenOutput>Settings.Designer.cs</LastGenOutput> | |||||
| </None> | |||||
| <Compile Include="Properties\Settings.Designer.cs"> | |||||
| <AutoGen>True</AutoGen> | |||||
| <DependentUpon>Settings.settings</DependentUpon> | |||||
| <DesignTimeSharedInput>True</DesignTimeSharedInput> | |||||
| </Compile> | |||||
| </ItemGroup> | |||||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |||||
| Other similar extension points exist, see Microsoft.Common.targets. | |||||
| <Target Name="BeforeBuild"> | |||||
| </Target> | |||||
| <Target Name="AfterBuild"> | |||||
| </Target> | |||||
| --> | |||||
| </Project> | |||||
| @ -0,0 +1,82 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.IO; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Xml.Serialization; | |||||
| namespace ButcherFactory.AutoUpdate | |||||
| { | |||||
| public class ClientVersion | |||||
| { | |||||
| public string Version { get; set; } | |||||
| public string ServerUrl { get; set; } | |||||
| private List<UpdateFile> _update = new List<UpdateFile>(); | |||||
| public List<UpdateFile> UpdateFiles { get { return _update; } set { _update = value; } } | |||||
| } | |||||
| public class UpdateFile | |||||
| { | |||||
| public string FileName { get; set; } | |||||
| public string Url { get; set; } | |||||
| public int Size { get; set; } | |||||
| public bool NeedRestart { get; set; } | |||||
| } | |||||
| public static class XmlUtil | |||||
| { | |||||
| public static T XmlDeserializeObject<T>(string xmlOfObject) where T : class | |||||
| { | |||||
| using (MemoryStream ms = new MemoryStream()) | |||||
| { | |||||
| using (StreamWriter sr = new StreamWriter(ms, Encoding.UTF8)) | |||||
| { | |||||
| sr.Write(xmlOfObject); | |||||
| sr.Flush(); | |||||
| ms.Seek(0, SeekOrigin.Begin); | |||||
| XmlSerializer serializer = new XmlSerializer(typeof(T)); | |||||
| return serializer.Deserialize(ms) as T; | |||||
| } | |||||
| } | |||||
| } | |||||
| public static T DeserializeFromFile<T>(string fileName = "") | |||||
| { | |||||
| if (string.IsNullOrWhiteSpace(fileName)) | |||||
| { | |||||
| fileName = typeof(T).Name + ".xml"; | |||||
| } | |||||
| if (!File.Exists(fileName)) | |||||
| { | |||||
| throw new FileNotFoundException("不存在文件:" + fileName); | |||||
| } | |||||
| using (var reader = new StreamReader(fileName)) | |||||
| { | |||||
| var xs = new XmlSerializer(typeof(T)); | |||||
| object obj = xs.Deserialize(reader); | |||||
| reader.Close(); | |||||
| return (T)obj; | |||||
| } | |||||
| } | |||||
| public static void SerializerObjToFile(object obj, string fileName = "") | |||||
| { | |||||
| if (string.IsNullOrWhiteSpace(fileName)) | |||||
| { | |||||
| fileName = obj.GetType().Name + ".xml"; | |||||
| } | |||||
| var ser = new XmlSerializer(obj.GetType()); | |||||
| using (var stream = File.Open(fileName, FileMode.Create)) | |||||
| { | |||||
| ser.Serialize(stream, obj); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,109 @@ | |||||
| namespace ButcherFactory.AutoUpdate | |||||
| { | |||||
| partial class Form1 | |||||
| { | |||||
| /// <summary> | |||||
| /// 必需的设计器变量。 | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// 清理所有正在使用的资源。 | |||||
| /// </summary> | |||||
| /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows 窗体设计器生成的代码 | |||||
| /// <summary> | |||||
| /// 设计器支持所需的方法 - 不要 | |||||
| /// 使用代码编辑器修改此方法的内容。 | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| this.progressBarTotal = new System.Windows.Forms.ProgressBar(); | |||||
| this.progressBarCurrent = new System.Windows.Forms.ProgressBar(); | |||||
| this.labelCurrentItem = new System.Windows.Forms.Label(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.labelCurrent = new System.Windows.Forms.Label(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // progressBarTotal | |||||
| // | |||||
| this.progressBarTotal.Location = new System.Drawing.Point(23, 88); | |||||
| this.progressBarTotal.Name = "progressBarTotal"; | |||||
| this.progressBarTotal.Size = new System.Drawing.Size(438, 12); | |||||
| this.progressBarTotal.Step = 1; | |||||
| this.progressBarTotal.TabIndex = 11; | |||||
| // | |||||
| // progressBarCurrent | |||||
| // | |||||
| this.progressBarCurrent.Location = new System.Drawing.Point(22, 49); | |||||
| this.progressBarCurrent.Name = "progressBarCurrent"; | |||||
| this.progressBarCurrent.Size = new System.Drawing.Size(438, 12); | |||||
| this.progressBarCurrent.Step = 1; | |||||
| this.progressBarCurrent.TabIndex = 12; | |||||
| // | |||||
| // labelCurrentItem | |||||
| // | |||||
| this.labelCurrentItem.AutoSize = true; | |||||
| this.labelCurrentItem.Location = new System.Drawing.Point(92, 34); | |||||
| this.labelCurrentItem.Name = "labelCurrentItem"; | |||||
| this.labelCurrentItem.Size = new System.Drawing.Size(0, 12); | |||||
| this.labelCurrentItem.TabIndex = 8; | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.AutoSize = true; | |||||
| this.label1.Location = new System.Drawing.Point(21, 73); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(53, 12); | |||||
| this.label1.TabIndex = 9; | |||||
| this.label1.Text = "总进度:"; | |||||
| // | |||||
| // labelCurrent | |||||
| // | |||||
| this.labelCurrent.AutoSize = true; | |||||
| this.labelCurrent.Location = new System.Drawing.Point(21, 34); | |||||
| this.labelCurrent.Name = "labelCurrent"; | |||||
| this.labelCurrent.Size = new System.Drawing.Size(65, 12); | |||||
| this.labelCurrent.TabIndex = 10; | |||||
| this.labelCurrent.Text = "正在下载:"; | |||||
| // | |||||
| // Form1 | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.ClientSize = new System.Drawing.Size(483, 134); | |||||
| this.ControlBox = false; | |||||
| this.Controls.Add(this.progressBarTotal); | |||||
| this.Controls.Add(this.progressBarCurrent); | |||||
| this.Controls.Add(this.labelCurrentItem); | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.labelCurrent); | |||||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; | |||||
| this.Name = "Form1"; | |||||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||||
| this.Text = "自动更新"; | |||||
| this.ResumeLayout(false); | |||||
| this.PerformLayout(); | |||||
| } | |||||
| #endregion | |||||
| private System.Windows.Forms.ProgressBar progressBarTotal; | |||||
| private System.Windows.Forms.ProgressBar progressBarCurrent; | |||||
| private System.Windows.Forms.Label labelCurrentItem; | |||||
| private System.Windows.Forms.Label label1; | |||||
| private System.Windows.Forms.Label labelCurrent; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,191 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Data; | |||||
| using System.Diagnostics; | |||||
| using System.Drawing; | |||||
| using System.IO; | |||||
| using System.Linq; | |||||
| using System.Net; | |||||
| using System.Text; | |||||
| using System.Threading; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.AutoUpdate | |||||
| { | |||||
| public partial class Form1 : Form | |||||
| { | |||||
| const string serUri = "http://172.28.1.194:7799/AutoUpdate/ClientVersion.xml"; | |||||
| const string PuKey = "c756e02cedb42a33f78091a466411bde8447d854"; | |||||
| private bool isFinished = false; | |||||
| private List<UpdateFile> downloadFileList = null; | |||||
| private ManualResetEvent evtDownload = null; | |||||
| private ManualResetEvent evtPerDonwload = null; | |||||
| private WebClient clientDownload = null; | |||||
| ClientVersion old; | |||||
| bool error = false; | |||||
| public Form1(string[] args) | |||||
| { | |||||
| InitializeComponent(); | |||||
| if (args == null || args.Length == 0 || args[0] != PuKey) | |||||
| error = true; | |||||
| this.Load += Form1_Load; | |||||
| } | |||||
| void Form1_Load(object sender, EventArgs e) | |||||
| { | |||||
| if (error) | |||||
| Application.Exit(); | |||||
| var versionFile = "ClientVersion.xml"; | |||||
| old = new ClientVersion(); | |||||
| if (File.Exists(versionFile)) | |||||
| old = XmlUtil.DeserializeFromFile<ClientVersion>(); | |||||
| if (string.IsNullOrEmpty(old.ServerUrl)) | |||||
| old.ServerUrl = serUri; | |||||
| clientDownload = new WebClient(); | |||||
| var version = XmlUtil.XmlDeserializeObject<ClientVersion>(clientDownload.DownloadString(old.ServerUrl)); | |||||
| old.ServerUrl = version.ServerUrl; | |||||
| old.Version = version.Version; | |||||
| downloadFileList = version.UpdateFiles; | |||||
| evtDownload = new ManualResetEvent(true); | |||||
| evtDownload.Reset(); | |||||
| Thread t = new Thread(new ThreadStart(ProcDownload)); | |||||
| t.Name = "download"; | |||||
| t.Start(); | |||||
| } | |||||
| long total = 0; | |||||
| long nDownloadedTotal = 0; | |||||
| string startFile = "ButcherFactory.Login.exe"; | |||||
| string oldFolder; | |||||
| private void ProcDownload() | |||||
| { | |||||
| evtPerDonwload = new ManualResetEvent(false); | |||||
| foreach (var file in this.downloadFileList) | |||||
| { | |||||
| total += file.Size; | |||||
| } | |||||
| oldFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "old"); | |||||
| if (!Directory.Exists(oldFolder)) | |||||
| Directory.CreateDirectory(oldFolder); | |||||
| while (!evtDownload.WaitOne(0, false)) | |||||
| { | |||||
| if (this.downloadFileList.Count == 0) | |||||
| break; | |||||
| var file = this.downloadFileList[0]; | |||||
| if (file.NeedRestart) | |||||
| startFile = file.FileName; | |||||
| this.ShowCurrentDownloadFileName(file.FileName); | |||||
| //下载 | |||||
| clientDownload = new WebClient(); | |||||
| clientDownload.DownloadProgressChanged += new DownloadProgressChangedEventHandler(OnDownloadProgressChanged); | |||||
| clientDownload.DownloadFileCompleted += new AsyncCompletedEventHandler(OnDownloadFileCompleted); | |||||
| evtPerDonwload.Reset(); | |||||
| clientDownload.DownloadFileAsync(new Uri(file.Url), Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName + ".tmp"), file); | |||||
| //等待下载完成 | |||||
| evtPerDonwload.WaitOne(); | |||||
| clientDownload.Dispose(); | |||||
| clientDownload = null; | |||||
| //移除已下载的文件 | |||||
| this.downloadFileList.Remove(file); | |||||
| } | |||||
| if (this.downloadFileList.Count == 0) | |||||
| { | |||||
| Exit(true); | |||||
| evtDownload.Set(); | |||||
| XmlUtil.SerializerObjToFile(old); | |||||
| Process.Start(Path.Combine(Application.StartupPath, startFile)); | |||||
| Application.Exit(); | |||||
| } | |||||
| else | |||||
| Exit(false); | |||||
| evtDownload.Set(); | |||||
| } | |||||
| void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e) | |||||
| { | |||||
| var file = e.UserState as UpdateFile; | |||||
| nDownloadedTotal += file.Size; | |||||
| this.SetProcessBar(0, (int)(nDownloadedTotal * 100 / total)); | |||||
| //备份文件 | |||||
| string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileName); | |||||
| var oldFile = Path.Combine(oldFolder, file.FileName); | |||||
| if (File.Exists(filePath)) | |||||
| { | |||||
| if (File.Exists(oldFile)) | |||||
| File.Delete(oldFile); | |||||
| File.Move(filePath, oldFile); | |||||
| } | |||||
| File.Move(filePath + ".tmp", filePath); | |||||
| //继续下载其它文件 | |||||
| evtPerDonwload.Set(); | |||||
| } | |||||
| void OnDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) | |||||
| { | |||||
| this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total)); | |||||
| } | |||||
| delegate void ShowCurrentDownloadFileNameCallBack(string name); | |||||
| private void ShowCurrentDownloadFileName(string name) | |||||
| { | |||||
| if (this.labelCurrentItem.InvokeRequired) | |||||
| { | |||||
| ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName); | |||||
| this.Invoke(cb, new object[] { name }); | |||||
| } | |||||
| else | |||||
| { | |||||
| this.labelCurrentItem.Text = name; | |||||
| } | |||||
| } | |||||
| delegate void SetProcessBarCallBack(int current, int total); | |||||
| private void SetProcessBar(int current, int total) | |||||
| { | |||||
| if (this.progressBarCurrent.InvokeRequired) | |||||
| { | |||||
| SetProcessBarCallBack cb = new SetProcessBarCallBack(SetProcessBar); | |||||
| this.Invoke(cb, new object[] { current, total }); | |||||
| } | |||||
| else | |||||
| { | |||||
| this.progressBarCurrent.Value = current; | |||||
| this.progressBarTotal.Value = total; | |||||
| } | |||||
| } | |||||
| delegate void ExitCallBack(bool success); | |||||
| private void Exit(bool success) | |||||
| { | |||||
| if (this.InvokeRequired) | |||||
| { | |||||
| ExitCallBack cb = new ExitCallBack(Exit); | |||||
| this.Invoke(cb, new object[] { success }); | |||||
| } | |||||
| else | |||||
| { | |||||
| this.isFinished = success; | |||||
| this.DialogResult = success ? DialogResult.OK : DialogResult.Cancel; | |||||
| this.Close(); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,120 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,21 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.AutoUpdate | |||||
| { | |||||
| static class Program | |||||
| { | |||||
| /// <summary> | |||||
| /// 应用程序的主入口点。 | |||||
| /// </summary> | |||||
| [STAThread] | |||||
| static void Main(string[] args) | |||||
| { | |||||
| Application.EnableVisualStyles(); | |||||
| Application.SetCompatibleTextRenderingDefault(false); | |||||
| Application.Run(new Form1(args)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,36 @@ | |||||
| using System.Reflection; | |||||
| using System.Runtime.CompilerServices; | |||||
| using System.Runtime.InteropServices; | |||||
| // 有关程序集的常规信息通过以下 | |||||
| // 特性集控制。更改这些特性值可修改 | |||||
| // 与程序集关联的信息。 | |||||
| [assembly: AssemblyTitle("ButcherFactory.AutoUpdate")] | |||||
| [assembly: AssemblyDescription("")] | |||||
| [assembly: AssemblyConfiguration("")] | |||||
| [assembly: AssemblyCompany("")] | |||||
| [assembly: AssemblyProduct("ButcherFactory.AutoUpdate")] | |||||
| [assembly: AssemblyCopyright("Copyright © 2018")] | |||||
| [assembly: AssemblyTrademark("")] | |||||
| [assembly: AssemblyCulture("")] | |||||
| // 将 ComVisible 设置为 false 使此程序集中的类型 | |||||
| // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, | |||||
| // 则将该类型上的 ComVisible 特性设置为 true。 | |||||
| [assembly: ComVisible(false)] | |||||
| // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||||
| [assembly: Guid("5e1a2475-93a3-4682-aa08-83365d70f1a2")] | |||||
| // 程序集的版本信息由下面四个值组成: | |||||
| // | |||||
| // 主版本 | |||||
| // 次版本 | |||||
| // 生成号 | |||||
| // 修订号 | |||||
| // | |||||
| // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, | |||||
| // 方法是按如下所示使用“*”: | |||||
| // [assembly: AssemblyVersion("1.0.*")] | |||||
| [assembly: AssemblyVersion("1.0.0.0")] | |||||
| [assembly: AssemblyFileVersion("1.0.0.0")] | |||||
| @ -0,0 +1,71 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <auto-generated> | |||||
| // 此代码由工具生成。 | |||||
| // 运行时版本: 4.0.30319.42000 | |||||
| // | |||||
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |||||
| // 重新生成代码,这些更改将丢失。 | |||||
| // </auto-generated> | |||||
| //------------------------------------------------------------------------------ | |||||
| namespace ButcherFactory.AutoUpdate.Properties | |||||
| { | |||||
| /// <summary> | |||||
| /// 一个强类型的资源类,用于查找本地化的字符串等。 | |||||
| /// </summary> | |||||
| // 此类是由 StronglyTypedResourceBuilder | |||||
| // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 | |||||
| // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen | |||||
| // (以 /str 作为命令选项),或重新生成 VS 项目。 | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] | |||||
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| internal class Resources | |||||
| { | |||||
| private static global::System.Resources.ResourceManager resourceMan; | |||||
| private static global::System.Globalization.CultureInfo resourceCulture; | |||||
| [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] | |||||
| internal Resources() | |||||
| { | |||||
| } | |||||
| /// <summary> | |||||
| /// 返回此类使用的、缓存的 ResourceManager 实例。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Resources.ResourceManager ResourceManager | |||||
| { | |||||
| get | |||||
| { | |||||
| if ((resourceMan == null)) | |||||
| { | |||||
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ButcherFactory.AutoUpdate.Properties.Resources", typeof(Resources).Assembly); | |||||
| resourceMan = temp; | |||||
| } | |||||
| return resourceMan; | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, | |||||
| /// 方法是使用此强类型资源类。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Globalization.CultureInfo Culture | |||||
| { | |||||
| get | |||||
| { | |||||
| return resourceCulture; | |||||
| } | |||||
| set | |||||
| { | |||||
| resourceCulture = value; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,117 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,30 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <auto-generated> | |||||
| // This code was generated by a tool. | |||||
| // Runtime Version:4.0.30319.42000 | |||||
| // | |||||
| // Changes to this file may cause incorrect behavior and will be lost if | |||||
| // the code is regenerated. | |||||
| // </auto-generated> | |||||
| //------------------------------------------------------------------------------ | |||||
| namespace ButcherFactory.AutoUpdate.Properties | |||||
| { | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] | |||||
| internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase | |||||
| { | |||||
| private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); | |||||
| public static Settings Default | |||||
| { | |||||
| get | |||||
| { | |||||
| return defaultInstance; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,7 @@ | |||||
| <?xml version='1.0' encoding='utf-8'?> | |||||
| <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> | |||||
| <Profiles> | |||||
| <Profile Name="(Default)" /> | |||||
| </Profiles> | |||||
| <Settings /> | |||||
| </SettingsFile> | |||||
| @ -0,0 +1,27 @@ | |||||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| namespace ButcherFactory.BO.LocalBL | |||||
| { | |||||
| public static class BLUtil | |||||
| { | |||||
| public static void DeleteLocalDb<T>() | |||||
| where T : SyncBill | |||||
| { | |||||
| var delete = new DQDeleteDom(typeof(T)); | |||||
| delete.Where.Conditions.Add(DQCondition.And(DQCondition.LessThan("CreateTime", DateTime.Today.AddDays(-3)), DQCondition.EQ("Sync", true))); | |||||
| delete.EExecute(); | |||||
| } | |||||
| public static void DeleteSaleOutStoreInfo<T>() | |||||
| { | |||||
| var delete = new DQDeleteDom(typeof(T)); | |||||
| delete.Where.Conditions.Add(DQCondition.LessThan("Time", DateTime.Today.AddDays(-3))); | |||||
| delete.EExecute(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,78 @@ | |||||
| namespace ButcherFactory.Controls | |||||
| { | |||||
| partial class InfoBox | |||||
| { | |||||
| /// <summary> | |||||
| /// Required designer variable. | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// Clean up any resources being used. | |||||
| /// </summary> | |||||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows Form Designer generated code | |||||
| /// <summary> | |||||
| /// Required method for Designer support - do not modify | |||||
| /// the contents of this method with the code editor. | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| this.button1 = new System.Windows.Forms.Button(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // button1 | |||||
| // | |||||
| this.button1.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.button1.Location = new System.Drawing.Point(180, 278); | |||||
| this.button1.Name = "button1"; | |||||
| this.button1.Size = new System.Drawing.Size(120, 56); | |||||
| this.button1.TabIndex = 0; | |||||
| this.button1.Text = "确定"; | |||||
| this.button1.UseVisualStyleBackColor = true; | |||||
| this.button1.Click += new System.EventHandler(this.button1_Click); | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.BackColor = System.Drawing.Color.White; | |||||
| this.label1.Font = new System.Drawing.Font("宋体", 18F); | |||||
| this.label1.ForeColor = System.Drawing.Color.Red; | |||||
| this.label1.Location = new System.Drawing.Point(30, 32); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(417, 222); | |||||
| this.label1.TabIndex = 1; | |||||
| this.label1.Text = "message"; | |||||
| this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||||
| // | |||||
| // InfoBox | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.BackColor = System.Drawing.Color.White; | |||||
| this.ClientSize = new System.Drawing.Size(485, 349); | |||||
| this.ControlBox = false; | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.button1); | |||||
| this.Name = "InfoBox"; | |||||
| this.Text = "title"; | |||||
| this.ResumeLayout(false); | |||||
| } | |||||
| #endregion | |||||
| private System.Windows.Forms.Button button1; | |||||
| private System.Windows.Forms.Label label1; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,74 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Data; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.Controls | |||||
| { | |||||
| public partial class InfoBox : Form | |||||
| { | |||||
| System.Timers.Timer timer; | |||||
| int sec = 0; | |||||
| public InfoBox(string title, string content,Color foreColor, int second) | |||||
| { | |||||
| InitializeComponent(); | |||||
| label1.Text = content; | |||||
| this.Text = title; | |||||
| this.label1.ForeColor = foreColor; | |||||
| button1.Text = "确定"; | |||||
| if (second > 0) | |||||
| { | |||||
| sec = second; | |||||
| timer = new System.Timers.Timer(); | |||||
| timer.Interval = 1000; | |||||
| timer.Elapsed += timer_Elapsed; | |||||
| timer.Start(); | |||||
| } | |||||
| this.FormClosing += DialogForm_FormClosing; | |||||
| } | |||||
| void DialogForm_FormClosing(object sender, FormClosingEventArgs e) | |||||
| { | |||||
| if (timer != null) | |||||
| { | |||||
| if (timer.Enabled) | |||||
| timer.Enabled = false; | |||||
| timer.Dispose(); | |||||
| } | |||||
| } | |||||
| void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | |||||
| { | |||||
| this.Invoke(new Action(() => | |||||
| { | |||||
| if (sec > 0) | |||||
| { | |||||
| button1.Text = string.Format("确定({0}秒)", sec); | |||||
| sec--; | |||||
| } | |||||
| else | |||||
| { | |||||
| timer.Enabled = false; | |||||
| this.Close(); | |||||
| } | |||||
| })); | |||||
| } | |||||
| public static void Show(string title, string msg,Color foreColor, int closeSec = 0) | |||||
| { | |||||
| var d = new InfoBox(title, msg,foreColor, closeSec); | |||||
| d.ShowDialog(); | |||||
| } | |||||
| private void button1_Click(object sender, EventArgs e) | |||||
| { | |||||
| this.Close(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,120 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,101 @@ | |||||
| namespace ButcherFactory.SegmentProductionAuto_ | |||||
| { | |||||
| partial class TemplateSelector | |||||
| { | |||||
| /// <summary> | |||||
| /// Required designer variable. | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// Clean up any resources being used. | |||||
| /// </summary> | |||||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows Form Designer generated code | |||||
| /// <summary> | |||||
| /// Required method for Designer support - do not modify | |||||
| /// the contents of this method with the code editor. | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| this.closeBtn = new ButcherFactory.Controls.ColorButton(); | |||||
| this.tp1 = new ButcherFactory.Controls.ColorButton(); | |||||
| this.tp2 = new ButcherFactory.Controls.ColorButton(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // closeBtn | |||||
| // | |||||
| this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); | |||||
| this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); | |||||
| this.closeBtn.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.closeBtn.ForeColor = System.Drawing.Color.White; | |||||
| this.closeBtn.Location = new System.Drawing.Point(176, 313); | |||||
| this.closeBtn.Name = "closeBtn"; | |||||
| this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); | |||||
| this.closeBtn.Size = new System.Drawing.Size(111, 41); | |||||
| this.closeBtn.TabIndex = 19; | |||||
| this.closeBtn.Text = "关闭"; | |||||
| this.closeBtn.UseVisualStyleBackColor = false; | |||||
| this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); | |||||
| // | |||||
| // tp1 | |||||
| // | |||||
| this.tp1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); | |||||
| this.tp1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||||
| this.tp1.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.tp1.ForeColor = System.Drawing.Color.White; | |||||
| this.tp1.Location = new System.Drawing.Point(134, 70); | |||||
| this.tp1.Name = "tp1"; | |||||
| this.tp1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); | |||||
| this.tp1.Size = new System.Drawing.Size(191, 62); | |||||
| this.tp1.TabIndex = 20; | |||||
| this.tp1.Text = "鲜品标签"; | |||||
| this.tp1.UseVisualStyleBackColor = false; | |||||
| this.tp1.Click += new System.EventHandler(this.tp1_Click); | |||||
| // | |||||
| // tp2 | |||||
| // | |||||
| this.tp2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); | |||||
| this.tp2.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.tp2.ForeColor = System.Drawing.Color.White; | |||||
| this.tp2.Location = new System.Drawing.Point(134, 159); | |||||
| this.tp2.Name = "tp2"; | |||||
| this.tp2.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); | |||||
| this.tp2.Size = new System.Drawing.Size(191, 62); | |||||
| this.tp2.TabIndex = 23; | |||||
| this.tp2.Text = "冻品标签"; | |||||
| this.tp2.UseVisualStyleBackColor = false; | |||||
| this.tp2.Click += new System.EventHandler(this.tp2_Click); | |||||
| // | |||||
| // TemplateSelector | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.BackColor = System.Drawing.Color.White; | |||||
| this.ClientSize = new System.Drawing.Size(461, 376); | |||||
| this.Controls.Add(this.tp2); | |||||
| this.Controls.Add(this.tp1); | |||||
| this.Controls.Add(this.closeBtn); | |||||
| this.Name = "TemplateSelector"; | |||||
| this.Text = "选择标签"; | |||||
| this.ResumeLayout(false); | |||||
| } | |||||
| #endregion | |||||
| private Controls.ColorButton closeBtn; | |||||
| private Controls.ColorButton tp1; | |||||
| private Controls.ColorButton tp2; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,55 @@ | |||||
| using ButcherFactory.BO.Utils; | |||||
| using ButcherFactory.SegmentProduction_; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Data; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| namespace ButcherFactory.SegmentProductionAuto_ | |||||
| { | |||||
| public partial class TemplateSelector : Form | |||||
| { | |||||
| SegmentProductionFormConfig config; | |||||
| public TemplateSelector(SegmentProductionFormConfig _config) | |||||
| { | |||||
| InitializeComponent(); | |||||
| config = _config; | |||||
| if (config.Template == "SegmentProductionPrint.html") | |||||
| tp1.Text += "(当前)"; | |||||
| else | |||||
| tp2.Text += "(当前)"; | |||||
| } | |||||
| private void closeBtn_Click(object sender, EventArgs e) | |||||
| { | |||||
| this.Close(); | |||||
| } | |||||
| private void tp1_Click(object sender, EventArgs e) | |||||
| { | |||||
| if (config.Template != "SegmentProductionPrint.html") | |||||
| { | |||||
| config.Template = "SegmentProductionPrint.html"; | |||||
| XmlUtil.SerializerObjToFile(config); | |||||
| tp1.Text = "鲜品标签(当前)"; | |||||
| tp2.Text = "冻品标签"; | |||||
| } | |||||
| } | |||||
| private void tp2_Click(object sender, EventArgs e) | |||||
| { | |||||
| if (config.Template != "SegmentProductionPrint1.html") | |||||
| { | |||||
| config.Template = "SegmentProductionPrint1.html"; | |||||
| XmlUtil.SerializerObjToFile(config); | |||||
| tp1.Text = "鲜品标签"; | |||||
| tp2.Text = "冻品标签(当前)"; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,120 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,28 @@ | |||||
| <html> | |||||
| <head> | |||||
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |||||
| <style type='text/css'> | |||||
| table tr td { | |||||
| font-size: 12px; | |||||
| font-weight: bold; | |||||
| } | |||||
| body { | |||||
| font-family: 微软雅黑; | |||||
| font-weight: bold; | |||||
| margin-left: 15px; | |||||
| } | |||||
| </style> | |||||
| </head> | |||||
| <body> | |||||
| <div style='font-size:16px;'>品名:$Goods_Name</div> | |||||
| <div style='margin-top:10px;font-size:14px;'>规格:$Goods_Spec 生产日期:$Date</div> | |||||
| <table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;line-height:15px;'> | |||||
| <tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='3'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr> | |||||
| <tr><td>储存条件:</td><td>-18℃以下保存</td></tr> | |||||
| <tr><td>保 质 期:</td><td>18个月</td></tr> | |||||
| <tr><td>生产厂家:</td><td colspan='2'>青岛万福集团股份有限公司</td></tr> | |||||
| <tr><td>生产厂址:</td><td colspan='2'>青岛莱西市珠海路五号</td></tr> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @ -0,0 +1,43 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Runtime.InteropServices; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| namespace ButcherFactory.SegmentStockUp_ | |||||
| { | |||||
| public static class PrintAPI | |||||
| { | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_GetUSBBufferLen(); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_EnumUSB(byte[] buf); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_CreateUSBPort(int nPort); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_Set_Direction(char direction); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_Prn_Text_TrueType(int x, int y, int FSize, string FType, | |||||
| int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, | |||||
| string data); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow, | |||||
| int width, int height, char human, string data); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_Bar2d_QR(int x, int y, int model, int scl, char error, | |||||
| char dinput, int c, int d, int p, string data); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern int B_Print_Out(int labset); | |||||
| [DllImport("Winpplb.dll")] | |||||
| public static extern void B_ClosePrn(); | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,10 @@ | |||||
| ^XA | |||||
| ^FT288,256^XG000.GRF,1,1^FS | |||||
| ^SEE:GB18030.DAT^FS | |||||
| ^CWJ,E:MSUNG24.FNT^FS | |||||
| ^CI26 | |||||
| ^FT20,100^AJN,36,36 ^FH\^FD客户:{0}^FS | |||||
| ^FT20,200^AJN,36,36 ^FH\^FD线路:{1}^FS | |||||
| ^FT20,300^AJN,36,36 ^FH\^FD日期:{2:yyyy/MM/dd}^FS | |||||
| ^PQ1,0,1,Y | |||||
| ^XZ | |||||
| @ -0,0 +1,15 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| namespace ButcherFactory.Login | |||||
| { | |||||
| public class ClientVersion | |||||
| { | |||||
| public string Version { get; set; } | |||||
| public string ServerUrl { get; set; } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,47 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.IO; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Xml.Serialization; | |||||
| namespace CreateUpdateXmlFile | |||||
| { | |||||
| public class ClientVersion | |||||
| { | |||||
| public string Version { get; set; } | |||||
| public string ServerUrl { get; set; } | |||||
| private List<UpdateFile> _update = new List<UpdateFile>(); | |||||
| public List<UpdateFile> UpdateFiles { get { return _update; } set { _update = value; } } | |||||
| } | |||||
| public class UpdateFile | |||||
| { | |||||
| public string FileName { get; set; } | |||||
| public string Url { get; set; } | |||||
| public int Size { get; set; } | |||||
| public bool NeedRestart { get; set; } | |||||
| } | |||||
| public static class XmlUtil | |||||
| { | |||||
| public static void SerializerObjToFile(object obj, string fileName = "") | |||||
| { | |||||
| if (string.IsNullOrWhiteSpace(fileName)) | |||||
| { | |||||
| fileName = obj.GetType().Name + ".xml"; | |||||
| } | |||||
| var ser = new XmlSerializer(obj.GetType()); | |||||
| using (var stream = File.Open(fileName, FileMode.Create)) | |||||
| { | |||||
| ser.Serialize(stream, obj); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,86 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <Project ToolsVersion="12.0" DefaultTargets="Build" 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>{BA0FF6E3-07FF-43A6-9AA6-D6ED88B46EB0}</ProjectGuid> | |||||
| <OutputType>WinExe</OutputType> | |||||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||||
| <RootNamespace>CreateUpdateXmlFile</RootNamespace> | |||||
| <AssemblyName>CreateUpdateXmlFile</AssemblyName> | |||||
| <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | |||||
| <FileAlignment>512</FileAlignment> | |||||
| </PropertyGroup> | |||||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| <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' "> | |||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| <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.Deployment" /> | |||||
| <Reference Include="System.Drawing" /> | |||||
| <Reference Include="System.Windows.Forms" /> | |||||
| <Reference Include="System.Xml" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <Compile Include="ClientVersion.cs" /> | |||||
| <Compile Include="Form1.cs"> | |||||
| <SubType>Form</SubType> | |||||
| </Compile> | |||||
| <Compile Include="Form1.Designer.cs"> | |||||
| <DependentUpon>Form1.cs</DependentUpon> | |||||
| </Compile> | |||||
| <Compile Include="Program.cs" /> | |||||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||||
| <EmbeddedResource Include="Form1.resx"> | |||||
| <DependentUpon>Form1.cs</DependentUpon> | |||||
| </EmbeddedResource> | |||||
| <EmbeddedResource Include="Properties\Resources.resx"> | |||||
| <Generator>ResXFileCodeGenerator</Generator> | |||||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | |||||
| <SubType>Designer</SubType> | |||||
| </EmbeddedResource> | |||||
| <Compile Include="Properties\Resources.Designer.cs"> | |||||
| <AutoGen>True</AutoGen> | |||||
| <DependentUpon>Resources.resx</DependentUpon> | |||||
| </Compile> | |||||
| <None Include="Properties\Settings.settings"> | |||||
| <Generator>SettingsSingleFileGenerator</Generator> | |||||
| <LastGenOutput>Settings.Designer.cs</LastGenOutput> | |||||
| </None> | |||||
| <Compile Include="Properties\Settings.Designer.cs"> | |||||
| <AutoGen>True</AutoGen> | |||||
| <DependentUpon>Settings.settings</DependentUpon> | |||||
| <DesignTimeSharedInput>True</DesignTimeSharedInput> | |||||
| </Compile> | |||||
| </ItemGroup> | |||||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |||||
| Other similar extension points exist, see Microsoft.Common.targets. | |||||
| <Target Name="BeforeBuild"> | |||||
| </Target> | |||||
| <Target Name="AfterBuild"> | |||||
| </Target> | |||||
| --> | |||||
| </Project> | |||||
| @ -0,0 +1,145 @@ | |||||
| namespace CreateUpdateXmlFile | |||||
| { | |||||
| partial class Form1 | |||||
| { | |||||
| /// <summary> | |||||
| /// 必需的设计器变量。 | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// 清理所有正在使用的资源。 | |||||
| /// </summary> | |||||
| /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows 窗体设计器生成的代码 | |||||
| /// <summary> | |||||
| /// 设计器支持所需的方法 - 不要 | |||||
| /// 使用代码编辑器修改此方法的内容。 | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| this.textBox3 = new System.Windows.Forms.TextBox(); | |||||
| this.label3 = new System.Windows.Forms.Label(); | |||||
| this.label2 = new System.Windows.Forms.Label(); | |||||
| this.textBox2 = new System.Windows.Forms.TextBox(); | |||||
| this.view = new System.Windows.Forms.Button(); | |||||
| this.create = new System.Windows.Forms.Button(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.textBox1 = new System.Windows.Forms.TextBox(); | |||||
| this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // textBox3 | |||||
| // | |||||
| this.textBox3.Location = new System.Drawing.Point(122, 34); | |||||
| this.textBox3.Name = "textBox3"; | |||||
| this.textBox3.Size = new System.Drawing.Size(285, 21); | |||||
| this.textBox3.TabIndex = 15; | |||||
| // | |||||
| // label3 | |||||
| // | |||||
| this.label3.AutoSize = true; | |||||
| this.label3.Location = new System.Drawing.Point(33, 37); | |||||
| this.label3.Name = "label3"; | |||||
| this.label3.Size = new System.Drawing.Size(53, 12); | |||||
| this.label3.TabIndex = 14; | |||||
| this.label3.Text = "主程序:"; | |||||
| // | |||||
| // label2 | |||||
| // | |||||
| this.label2.AutoSize = true; | |||||
| this.label2.Location = new System.Drawing.Point(33, 80); | |||||
| this.label2.Name = "label2"; | |||||
| this.label2.Size = new System.Drawing.Size(77, 12); | |||||
| this.label2.TabIndex = 13; | |||||
| this.label2.Text = "服务器地址:"; | |||||
| // | |||||
| // textBox2 | |||||
| // | |||||
| this.textBox2.Location = new System.Drawing.Point(122, 77); | |||||
| this.textBox2.Name = "textBox2"; | |||||
| this.textBox2.Size = new System.Drawing.Size(390, 21); | |||||
| this.textBox2.TabIndex = 12; | |||||
| // | |||||
| // view | |||||
| // | |||||
| this.view.Location = new System.Drawing.Point(133, 188); | |||||
| this.view.Name = "view"; | |||||
| this.view.Size = new System.Drawing.Size(93, 38); | |||||
| this.view.TabIndex = 11; | |||||
| this.view.Text = "浏览"; | |||||
| this.view.UseVisualStyleBackColor = true; | |||||
| this.view.Click += new System.EventHandler(this.view_Click); | |||||
| // | |||||
| // create | |||||
| // | |||||
| this.create.Location = new System.Drawing.Point(303, 188); | |||||
| this.create.Name = "create"; | |||||
| this.create.Size = new System.Drawing.Size(93, 38); | |||||
| this.create.TabIndex = 10; | |||||
| this.create.Text = "生成"; | |||||
| this.create.UseVisualStyleBackColor = true; | |||||
| this.create.Click += new System.EventHandler(this.create_Click); | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.AutoSize = true; | |||||
| this.label1.Location = new System.Drawing.Point(33, 108); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(65, 12); | |||||
| this.label1.TabIndex = 9; | |||||
| this.label1.Text = "目录选择:"; | |||||
| // | |||||
| // textBox1 | |||||
| // | |||||
| this.textBox1.Font = new System.Drawing.Font("宋体", 12F); | |||||
| this.textBox1.Location = new System.Drawing.Point(104, 108); | |||||
| this.textBox1.Multiline = true; | |||||
| this.textBox1.Name = "textBox1"; | |||||
| this.textBox1.Size = new System.Drawing.Size(408, 59); | |||||
| this.textBox1.TabIndex = 8; | |||||
| // | |||||
| // Form1 | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.ClientSize = new System.Drawing.Size(545, 261); | |||||
| this.Controls.Add(this.textBox3); | |||||
| this.Controls.Add(this.label3); | |||||
| this.Controls.Add(this.label2); | |||||
| this.Controls.Add(this.textBox2); | |||||
| this.Controls.Add(this.view); | |||||
| this.Controls.Add(this.create); | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.textBox1); | |||||
| this.Name = "Form1"; | |||||
| this.Text = "Form1"; | |||||
| this.ResumeLayout(false); | |||||
| this.PerformLayout(); | |||||
| } | |||||
| #endregion | |||||
| private System.Windows.Forms.TextBox textBox3; | |||||
| private System.Windows.Forms.Label label3; | |||||
| private System.Windows.Forms.Label label2; | |||||
| private System.Windows.Forms.TextBox textBox2; | |||||
| private System.Windows.Forms.Button view; | |||||
| private System.Windows.Forms.Button create; | |||||
| private System.Windows.Forms.Label label1; | |||||
| private System.Windows.Forms.TextBox textBox1; | |||||
| private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,56 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.ComponentModel; | |||||
| using System.Data; | |||||
| using System.Drawing; | |||||
| using System.IO; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Windows.Forms; | |||||
| namespace CreateUpdateXmlFile | |||||
| { | |||||
| public partial class Form1 : Form | |||||
| { | |||||
| public Form1() | |||||
| { | |||||
| InitializeComponent(); | |||||
| this.textBox2.Text = "http://172.28.1.194:7799/AutoUpdate/"; | |||||
| this.textBox3.Text = "ButcherFactory.Login.exe"; | |||||
| } | |||||
| private void view_Click(object sender, EventArgs e) | |||||
| { | |||||
| if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) | |||||
| this.textBox1.Text = folderBrowserDialog1.SelectedPath; | |||||
| } | |||||
| private void create_Click(object sender, EventArgs e) | |||||
| { | |||||
| if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "") | |||||
| { | |||||
| MessageBox.Show("请完善信息"); | |||||
| return; | |||||
| } | |||||
| var entity = new ClientVersion(); | |||||
| entity.ServerUrl = textBox2.Text + "ClientVersion.xml"; | |||||
| entity.Version = DateTime.Now.ToString("yyyyMMddHHmm"); | |||||
| var folder = new DirectoryInfo(textBox1.Text); | |||||
| foreach (var file in folder.GetFiles()) | |||||
| { | |||||
| if (file.Name == "ButcherFactory.AutoUpdate.exe") | |||||
| continue; | |||||
| if (file.Extension == ".xml" && file.Name != "ClientVersion.xml") | |||||
| continue; | |||||
| var detail = new UpdateFile(); | |||||
| detail.FileName = file.Name; | |||||
| detail.NeedRestart = textBox3.Text == detail.FileName; | |||||
| detail.Size = (int)file.Length; | |||||
| detail.Url = textBox2.Text + detail.FileName; | |||||
| entity.UpdateFiles.Add(detail); | |||||
| } | |||||
| XmlUtil.SerializerObjToFile(entity); | |||||
| MessageBox.Show("OK"); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,123 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| <xsd:attribute ref="xml:space" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||||
| <value>17, 17</value> | |||||
| </metadata> | |||||
| </root> | |||||
| @ -0,0 +1,21 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Windows.Forms; | |||||
| namespace CreateUpdateXmlFile | |||||
| { | |||||
| static class Program | |||||
| { | |||||
| /// <summary> | |||||
| /// 应用程序的主入口点。 | |||||
| /// </summary> | |||||
| [STAThread] | |||||
| static void Main() | |||||
| { | |||||
| Application.EnableVisualStyles(); | |||||
| Application.SetCompatibleTextRenderingDefault(false); | |||||
| Application.Run(new Form1()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,36 @@ | |||||
| using System.Reflection; | |||||
| using System.Runtime.CompilerServices; | |||||
| using System.Runtime.InteropServices; | |||||
| // 有关程序集的常规信息通过以下 | |||||
| // 特性集控制。更改这些特性值可修改 | |||||
| // 与程序集关联的信息。 | |||||
| [assembly: AssemblyTitle("CreateUpdateXmlFile")] | |||||
| [assembly: AssemblyDescription("")] | |||||
| [assembly: AssemblyConfiguration("")] | |||||
| [assembly: AssemblyCompany("")] | |||||
| [assembly: AssemblyProduct("CreateUpdateXmlFile")] | |||||
| [assembly: AssemblyCopyright("Copyright © 2018")] | |||||
| [assembly: AssemblyTrademark("")] | |||||
| [assembly: AssemblyCulture("")] | |||||
| // 将 ComVisible 设置为 false 使此程序集中的类型 | |||||
| // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, | |||||
| // 则将该类型上的 ComVisible 特性设置为 true。 | |||||
| [assembly: ComVisible(false)] | |||||
| // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||||
| [assembly: Guid("abeac87b-e426-4ade-b0cc-b9f8ddc31a99")] | |||||
| // 程序集的版本信息由下面四个值组成: | |||||
| // | |||||
| // 主版本 | |||||
| // 次版本 | |||||
| // 生成号 | |||||
| // 修订号 | |||||
| // | |||||
| // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, | |||||
| // 方法是按如下所示使用“*”: | |||||
| // [assembly: AssemblyVersion("1.0.*")] | |||||
| [assembly: AssemblyVersion("1.0.0.0")] | |||||
| [assembly: AssemblyFileVersion("1.0.0.0")] | |||||
| @ -0,0 +1,71 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <auto-generated> | |||||
| // 此代码由工具生成。 | |||||
| // 运行时版本: 4.0.30319.42000 | |||||
| // | |||||
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |||||
| // 重新生成代码,这些更改将丢失。 | |||||
| // </auto-generated> | |||||
| //------------------------------------------------------------------------------ | |||||
| namespace CreateUpdateXmlFile.Properties | |||||
| { | |||||
| /// <summary> | |||||
| /// 一个强类型的资源类,用于查找本地化的字符串等。 | |||||
| /// </summary> | |||||
| // 此类是由 StronglyTypedResourceBuilder | |||||
| // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 | |||||
| // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen | |||||
| // (以 /str 作为命令选项),或重新生成 VS 项目。 | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] | |||||
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| internal class Resources | |||||
| { | |||||
| private static global::System.Resources.ResourceManager resourceMan; | |||||
| private static global::System.Globalization.CultureInfo resourceCulture; | |||||
| [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] | |||||
| internal Resources() | |||||
| { | |||||
| } | |||||
| /// <summary> | |||||
| /// 返回此类使用的、缓存的 ResourceManager 实例。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Resources.ResourceManager ResourceManager | |||||
| { | |||||
| get | |||||
| { | |||||
| if ((resourceMan == null)) | |||||
| { | |||||
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CreateUpdateXmlFile.Properties.Resources", typeof(Resources).Assembly); | |||||
| resourceMan = temp; | |||||
| } | |||||
| return resourceMan; | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, | |||||
| /// 方法是使用此强类型资源类。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Globalization.CultureInfo Culture | |||||
| { | |||||
| get | |||||
| { | |||||
| return resourceCulture; | |||||
| } | |||||
| set | |||||
| { | |||||
| resourceCulture = value; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,117 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <root> | |||||
| <!-- | |||||
| Microsoft ResX Schema | |||||
| Version 2.0 | |||||
| The primary goals of this format is to allow a simple XML format | |||||
| that is mostly human readable. The generation and parsing of the | |||||
| various data types are done through the TypeConverter classes | |||||
| associated with the data types. | |||||
| Example: | |||||
| ... ado.net/XML headers & schema ... | |||||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
| <resheader name="version">2.0</resheader> | |||||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
| </data> | |||||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
| <comment>This is a comment</comment> | |||||
| </data> | |||||
| There are any number of "resheader" rows that contain simple | |||||
| name/value pairs. | |||||
| Each data row contains a name, and value. The row also contains a | |||||
| type or mimetype. Type corresponds to a .NET class that support | |||||
| text/value conversion through the TypeConverter architecture. | |||||
| Classes that don't support this are serialized and stored with the | |||||
| mimetype set. | |||||
| The mimetype is used for serialized objects, and tells the | |||||
| ResXResourceReader how to depersist the object. This is currently not | |||||
| extensible. For a given mimetype the value must be set accordingly: | |||||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
| that the ResXResourceWriter will generate, however the reader can | |||||
| read any of the formats listed below. | |||||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Serialization.Formatters.Binary.BinaryFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||||
| value : The object must be serialized with | |||||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
| : and then encoded with base64 encoding. | |||||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
| value : The object must be serialized into a byte array | |||||
| : using a System.ComponentModel.TypeConverter | |||||
| : and then encoded with base64 encoding. | |||||
| --> | |||||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||||
| <xsd:complexType> | |||||
| <xsd:choice maxOccurs="unbounded"> | |||||
| <xsd:element name="metadata"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| <xsd:attribute name="type" type="xsd:string" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="assembly"> | |||||
| <xsd:complexType> | |||||
| <xsd:attribute name="alias" type="xsd:string" /> | |||||
| <xsd:attribute name="name" type="xsd:string" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="data"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> | |||||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| <xsd:element name="resheader"> | |||||
| <xsd:complexType> | |||||
| <xsd:sequence> | |||||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
| </xsd:sequence> | |||||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:choice> | |||||
| </xsd:complexType> | |||||
| </xsd:element> | |||||
| </xsd:schema> | |||||
| <resheader name="resmimetype"> | |||||
| <value>text/microsoft-resx</value> | |||||
| </resheader> | |||||
| <resheader name="version"> | |||||
| <value>2.0</value> | |||||
| </resheader> | |||||
| <resheader name="reader"> | |||||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| <resheader name="writer"> | |||||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
| </resheader> | |||||
| </root> | |||||
| @ -0,0 +1,30 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <auto-generated> | |||||
| // This code was generated by a tool. | |||||
| // Runtime Version:4.0.30319.42000 | |||||
| // | |||||
| // Changes to this file may cause incorrect behavior and will be lost if | |||||
| // the code is regenerated. | |||||
| // </auto-generated> | |||||
| //------------------------------------------------------------------------------ | |||||
| namespace CreateUpdateXmlFile.Properties | |||||
| { | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] | |||||
| internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase | |||||
| { | |||||
| private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); | |||||
| public static Settings Default | |||||
| { | |||||
| get | |||||
| { | |||||
| return defaultInstance; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,7 @@ | |||||
| <?xml version='1.0' encoding='utf-8'?> | |||||
| <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> | |||||
| <Profiles> | |||||
| <Profile Name="(Default)" /> | |||||
| </Profiles> | |||||
| <Settings /> | |||||
| </SettingsFile> | |||||