| @ -0,0 +1,68 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.IO; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Xml.Serialization; | |||||
| namespace 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; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8" ?> | |||||
| <configuration> | |||||
| <startup> | |||||
| <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |||||
| </startup> | |||||
| </configuration> | |||||
| @ -0,0 +1,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,89 @@ | |||||
| <?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>{57BB1A02-118A-443D-A38A-BB36B9A77F6A}</ProjectGuid> | |||||
| <OutputType>WinExe</OutputType> | |||||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||||
| <RootNamespace>CreateUpdateXmlFile</RootNamespace> | |||||
| <AssemblyName>CreateUpdateXmlFile</AssemblyName> | |||||
| <TargetFrameworkVersion>v4.5</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> | |||||
| <ItemGroup> | |||||
| <None Include="App.config" /> | |||||
| </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.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); | |||||
| this.textBox1 = new System.Windows.Forms.TextBox(); | |||||
| this.label1 = new System.Windows.Forms.Label(); | |||||
| this.create = new System.Windows.Forms.Button(); | |||||
| this.view = new System.Windows.Forms.Button(); | |||||
| this.textBox2 = new System.Windows.Forms.TextBox(); | |||||
| this.label2 = new System.Windows.Forms.Label(); | |||||
| this.label3 = new System.Windows.Forms.Label(); | |||||
| this.textBox3 = new System.Windows.Forms.TextBox(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // textBox1 | |||||
| // | |||||
| this.textBox1.Font = new System.Drawing.Font("宋体", 12F); | |||||
| this.textBox1.Location = new System.Drawing.Point(97, 98); | |||||
| this.textBox1.Multiline = true; | |||||
| this.textBox1.Name = "textBox1"; | |||||
| this.textBox1.Size = new System.Drawing.Size(408, 59); | |||||
| this.textBox1.TabIndex = 0; | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.AutoSize = true; | |||||
| this.label1.Location = new System.Drawing.Point(26, 98); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(65, 12); | |||||
| this.label1.TabIndex = 1; | |||||
| this.label1.Text = "目录选择:"; | |||||
| // | |||||
| // create | |||||
| // | |||||
| this.create.Location = new System.Drawing.Point(296, 178); | |||||
| this.create.Name = "create"; | |||||
| this.create.Size = new System.Drawing.Size(93, 38); | |||||
| this.create.TabIndex = 2; | |||||
| this.create.Text = "生成"; | |||||
| this.create.UseVisualStyleBackColor = true; | |||||
| this.create.Click += new System.EventHandler(this.create_Click); | |||||
| // | |||||
| // view | |||||
| // | |||||
| this.view.Location = new System.Drawing.Point(126, 178); | |||||
| this.view.Name = "view"; | |||||
| this.view.Size = new System.Drawing.Size(93, 38); | |||||
| this.view.TabIndex = 3; | |||||
| this.view.Text = "浏览"; | |||||
| this.view.UseVisualStyleBackColor = true; | |||||
| this.view.Click += new System.EventHandler(this.view_Click); | |||||
| // | |||||
| // textBox2 | |||||
| // | |||||
| this.textBox2.Location = new System.Drawing.Point(115, 67); | |||||
| this.textBox2.Name = "textBox2"; | |||||
| this.textBox2.Size = new System.Drawing.Size(390, 21); | |||||
| this.textBox2.TabIndex = 4; | |||||
| // | |||||
| // label2 | |||||
| // | |||||
| this.label2.AutoSize = true; | |||||
| this.label2.Location = new System.Drawing.Point(26, 70); | |||||
| this.label2.Name = "label2"; | |||||
| this.label2.Size = new System.Drawing.Size(77, 12); | |||||
| this.label2.TabIndex = 5; | |||||
| this.label2.Text = "服务器地址:"; | |||||
| // | |||||
| // label3 | |||||
| // | |||||
| this.label3.AutoSize = true; | |||||
| this.label3.Location = new System.Drawing.Point(26, 27); | |||||
| this.label3.Name = "label3"; | |||||
| this.label3.Size = new System.Drawing.Size(53, 12); | |||||
| this.label3.TabIndex = 6; | |||||
| this.label3.Text = "主程序:"; | |||||
| // | |||||
| // textBox3 | |||||
| // | |||||
| this.textBox3.Location = new System.Drawing.Point(115, 24); | |||||
| this.textBox3.Name = "textBox3"; | |||||
| this.textBox3.Size = new System.Drawing.Size(285, 21); | |||||
| this.textBox3.TabIndex = 7; | |||||
| // | |||||
| // 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.FolderBrowserDialog folderBrowserDialog1; | |||||
| private System.Windows.Forms.TextBox textBox1; | |||||
| private System.Windows.Forms.Label label1; | |||||
| private System.Windows.Forms.Button create; | |||||
| private System.Windows.Forms.Button view; | |||||
| private System.Windows.Forms.TextBox textBox2; | |||||
| private System.Windows.Forms.Label label2; | |||||
| private System.Windows.Forms.Label label3; | |||||
| private System.Windows.Forms.TextBox textBox3; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,57 @@ | |||||
| 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; | |||||
| using System.IO; | |||||
| namespace CreateUpdateXmlFile | |||||
| { | |||||
| public partial class Form1 : Form | |||||
| { | |||||
| public Form1() | |||||
| { | |||||
| InitializeComponent(); | |||||
| this.textBox2.Text = "http://172.28.1.194:7799/AutoUpdate/"; | |||||
| this.textBox3.Text = "ButcherManageClient.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 == "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,22 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| 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 © 2017")] | |||||
| [assembly: AssemblyTrademark("")] | |||||
| [assembly: AssemblyCulture("")] | |||||
| // 将 ComVisible 设置为 false 使此程序集中的类型 | |||||
| // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, | |||||
| // 则将该类型上的 ComVisible 特性设置为 true。 | |||||
| [assembly: ComVisible(false)] | |||||
| // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||||
| [assembly: Guid("9502ffc3-cd87-4eea-adbe-6bac36ca04f8")] | |||||
| // 程序集的版本信息由下面四个值组成: | |||||
| // | |||||
| // 主版本 | |||||
| // 次版本 | |||||
| // 生成号 | |||||
| // 修订号 | |||||
| // | |||||
| // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, | |||||
| // 方法是按如下所示使用“*”: | |||||
| // [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> | |||||