ソースを参照

添加文件打包工具软件,修改string到version的转换

yuzhengyang 8 年 前
コミット
bb7db96bd2

BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


+ 0 - 1
Fork.Net/Fork.Net.Tools/Version.Builder/FodyWeavers.xml

@@ -1,4 +1,3 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Weavers>
-  <Costura />
 </Weavers>

+ 0 - 6
Fork.Net/Fork.Net.Tools/Version.Builder/Version.Builder.csproj

@@ -69,7 +69,6 @@
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
-    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -87,12 +86,7 @@
     <None Include="FodyWeavers.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\Fody.2.0.6\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.2.0.6\build\dotnet\Fody.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\Fody.2.0.6\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.0.6\build\dotnet\Fody.targets'))" />
   </Target>
   <!-- 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.

+ 0 - 5
Fork.Net/Fork.Net.Tools/Version.Builder/packages.config

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="Costura.Fody" version="1.4.1" targetFramework="net452" developmentDependency="true" />
-  <package id="Fody" version="2.0.6" targetFramework="net452" developmentDependency="true" />
-</packages>

+ 1 - 1
Fork.Net/Fork.Net.Tools/Y.Utils/IOUtils/PathUtils/AppDirTool.cs

@@ -16,7 +16,7 @@ namespace Y.Utils.IOUtils.PathUtils
             {
                 foreach (var dic in dictionary)
                 {
-                    if (path.Contains(dic.Key))
+                    if (dic.Key != null && dic.Value != null && path.Contains(dic.Key))
                     {
                         result = path.Replace(dic.Key, dic.Value);
                         break;

+ 21 - 15
Fork.Net/Fork.Net.Tools/Y.Utils/UpdateUtils/AppUpdateTool.cs

@@ -16,6 +16,7 @@ using Y.Utils.IOUtils.FileUtils;
 using Y.Utils.IOUtils.PathUtils;
 using Y.Utils.NetUtils.FTPUtils;
 using Y.Utils.NetUtils.HttpUtils;
+using Y.Utils.VersionUtils;
 
 namespace Y.Utils.UpdateUtils
 {
@@ -28,7 +29,6 @@ namespace Y.Utils.UpdateUtils
         /// 获取新版本
         /// </summary>
         /// <param name="url"></param>
-        /// <param name="name"></param>
         /// <param name="version"></param>
         /// <param name="info"></param>
         /// <returns>
@@ -43,7 +43,7 @@ namespace Y.Utils.UpdateUtils
             info = HttpTool.Get<AppUpdateInfo>(url);
             if (info != null)
             {
-                Version newVersion = FormatVersion(info.Version);
+                Version newVersion = VersionTool.Format(info.Version);
                 if (newVersion != null && newVersion > version)
                 {
                     stopwatch.Stop();
@@ -109,22 +109,28 @@ namespace Y.Utils.UpdateUtils
                 return -10000;//没有新版本
             }
         }
-        private Version FormatVersion(string s)
+        private string Download(string file, AppUpdateInfo info, ProgressDelegate.ProgressHandler progress = null, object sender = null)
         {
-            //解析最新版本号
-            Version version = null;
-            try
+            if (info != null)
             {
-                version = new Version(s);
+                switch (info.DownloadMode)
+                {
+                    case 0://http 下载
+                        {
+                            if (HttpTool.Download(info.HttpUrl, file, progress, sender))
+                                return file;
+                        }
+                        break;
+
+                    case 1://ftp 下载  
+                        {
+                            FtpTool ftp = new FtpTool(info.FtpIp, info.FtpAccount, info.FtpPassword);
+                            if (ftp.Download(info.FtpFile, file, progress, sender))
+                                return file;
+                        }
+                        break;
+                }
             }
-            catch (Exception e) { }
-            return version;
-        }
-        private string Download(string file, AppUpdateInfo info, ProgressDelegate.ProgressHandler progress = null, object sender = null)
-        {
-            FtpTool ftp = new FtpTool(info.FtpIp, info.FtpAccount, info.FtpPassword);
-            if (ftp.Download(info.FtpFile, file, progress, sender))
-                return file;
             return null;
         }
     }

+ 22 - 0
Fork.Net/Fork.Net.Tools/Y.Utils/VersionUtils/VersionTool.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Y.Utils.VersionUtils
+{
+    public class VersionTool
+    {
+        public static Version Format(string s)
+        {
+            //解析最新版本号
+            Version version = null;
+            try
+            {
+                version = new Version(s);
+            }
+            catch (Exception e) { }
+            return version;
+        }
+    }
+}

+ 1 - 0
Fork.Net/Fork.Net.Tools/Y.Utils/Y.Utils.csproj

@@ -97,6 +97,7 @@
     <Compile Include="SoftwareUtils\SoftwareTool.cs" />
     <Compile Include="TaskServiceUtils\TaskServiceDaddy.cs" />
     <Compile Include="TaskServiceUtils\TestTaskService.cs" />
+    <Compile Include="VersionUtils\VersionTool.cs" />
     <Compile Include="WindowsUtils\APIUtils\FormStyleAPI.cs" />
     <Compile Include="WindowsUtils\APIUtils\PermissionAPI.cs" />
     <Compile Include="WindowsUtils\APIUtils\WindowsHotKeyAPI.cs" />

+ 33 - 24
Fork.Net/Fork.Net.sln

@@ -5,12 +5,6 @@ VisualStudioVersion = 15.0.26730.12
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fork.Net", "Fork.Net\Fork.Net.csproj", "{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Winform.Version", "Winform.Version", "{F32378B4-3DDB-491A-8485-20634188C0FD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version.Builder", "Version.Builder\Version.Builder.csproj", "{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version.Update", "Version.Update\Version.Update.csproj", "{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fork.Net.Tools", "Fork.Net.Tools", "{F222E566-DA0C-443C-BB9F-80536F02DB36}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Waka.Lego", "Waka.Lego", "{0DB08A6B-6960-48CD-B23B-6428F47FDA60}"
@@ -63,6 +57,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azylee.ExeLaunch", "Azylee.
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppSettle.Test", "Test\AppSettle.Test\AppSettle.Test.csproj", "{3C32DCA5-4E44-4701-A0C5-FA19272C128B}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version.Builder", "Fork.Net.Tools\Version.Builder\Version.Builder.csproj", "{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version.Update", "Fork.Net.Tools\Version.Update\Version.Update.csproj", "{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Oreo.FilePackage", "Oreo.Plugins\Oreo.FilePackage\Oreo.FilePackage.csproj", "{1500F997-4261-4999-A6F1-0EBB34E9854F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -79,22 +79,6 @@ Global
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|Any CPU.Build.0 = Release|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|x86.ActiveCfg = Release|Any CPU
 		{A8EBC472-2AF6-41B1-B1A0-C4D28D165C02}.Release|x86.Build.0 = Release|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.Build.0 = Debug|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.ActiveCfg = Release|Any CPU
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.Build.0 = Release|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.Build.0 = Debug|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.ActiveCfg = Release|Any CPU
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.Build.0 = Release|Any CPU
 		{A7365B83-32FF-4B92-8C80-A450AC92007F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A7365B83-32FF-4B92-8C80-A450AC92007F}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A7365B83-32FF-4B92-8C80-A450AC92007F}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -263,13 +247,35 @@ Global
 		{3C32DCA5-4E44-4701-A0C5-FA19272C128B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{3C32DCA5-4E44-4701-A0C5-FA19272C128B}.Release|x86.ActiveCfg = Release|Any CPU
 		{3C32DCA5-4E44-4701-A0C5-FA19272C128B}.Release|x86.Build.0 = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Debug|x86.Build.0 = Debug|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.ActiveCfg = Release|Any CPU
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B}.Release|x86.Build.0 = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Debug|x86.Build.0 = Debug|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.ActiveCfg = Release|Any CPU
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E}.Release|x86.Build.0 = Release|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Debug|x86.Build.0 = Debug|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Release|x86.ActiveCfg = Release|Any CPU
+		{1500F997-4261-4999-A6F1-0EBB34E9854F}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
-		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B} = {F32378B4-3DDB-491A-8485-20634188C0FD}
-		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{A7365B83-32FF-4B92-8C80-A450AC92007F} = {E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}
 		{44A1823B-EA31-4BAF-B264-0471C149D703} = {E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}
 		{62A9E0A6-2B00-4E44-8058-3611AF55280C} = {E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}
@@ -291,6 +297,9 @@ Global
 		{88DC61FA-95F0-41B7-9D7D-AB0F3CBD169C} = {C34A95B5-5F83-46E3-868A-56BDDA2D0B87}
 		{1AB11F85-BA96-4F82-8122-BB89E63FCCB1} = {C34A95B5-5F83-46E3-868A-56BDDA2D0B87}
 		{3C32DCA5-4E44-4701-A0C5-FA19272C128B} = {A89FC45A-A907-4487-8719-114530A62684}
+		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
+		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
+		{1500F997-4261-4999-A6F1-0EBB34E9854F} = {E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {5436696D-5F55-490A-AB40-050B54BE2AB4}

+ 10 - 0
Fork.Net/Oreo.Plugins/Oreo.FileMan/Oreo.FileMan.csproj

@@ -215,6 +215,16 @@
     <Content Include="Images\Icon\Icon.ico" />
     <Content Include="Images\WaitingGif\Wait-Hor.gif" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Fork.Net.Tools\Y.Skin\Y.Skin.csproj">
+      <Project>{e9a97673-3e27-4a49-90bc-8806411a2f57}</Project>
+      <Name>Y.Skin</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\Fork.Net.Tools\Y.Utils\Y.Utils.csproj">
+      <Project>{5b8eeec7-aeb5-407d-9dc1-1c59e53f78d5}</Project>
+      <Name>Y.Utils</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.105.2\build\net40\System.Data.SQLite.Core.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

+ 6 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/App.config

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

+ 73 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Form1.Designer.cs

@@ -0,0 +1,73 @@
+namespace Oreo.FilePackage
+{
+    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.BTPack = new System.Windows.Forms.Button();
+            this.TBPath = new System.Windows.Forms.TextBox();
+            this.SuspendLayout();
+            // 
+            // BTPack
+            // 
+            this.BTPack.Location = new System.Drawing.Point(402, 13);
+            this.BTPack.Name = "BTPack";
+            this.BTPack.Size = new System.Drawing.Size(75, 23);
+            this.BTPack.TabIndex = 0;
+            this.BTPack.Text = "打包";
+            this.BTPack.UseVisualStyleBackColor = true;
+            this.BTPack.Click += new System.EventHandler(this.BTPack_Click);
+            // 
+            // TBPath
+            // 
+            this.TBPath.Location = new System.Drawing.Point(13, 13);
+            this.TBPath.Name = "TBPath";
+            this.TBPath.Size = new System.Drawing.Size(358, 21);
+            this.TBPath.TabIndex = 1;
+            this.TBPath.TextChanged += new System.EventHandler(this.TBPath_TextChanged);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(489, 182);
+            this.Controls.Add(this.TBPath);
+            this.Controls.Add(this.BTPack);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button BTPack;
+        private System.Windows.Forms.TextBox TBPath;
+    }
+}
+

+ 36 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Form1.cs

@@ -0,0 +1,36 @@
+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.Threading.Tasks;
+using System.Windows.Forms;
+using Y.Utils.IOUtils.FileUtils;
+using Y.Utils.IOUtils.PathUtils;
+
+namespace Oreo.FilePackage
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void BTPack_Click(object sender, EventArgs e)
+        {
+            string src = TBPath.Text;
+            string file = Path.GetFileName(src) + ".package";
+            string dst = DirTool.Combine(DirTool.GetFilePath(TBPath.Text), file);
+            FilePackageTool.Pack(src, dst);
+        }
+
+        private void TBPath_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Form1.resx

@@ -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>

+ 88 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Oreo.FilePackage.csproj

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1500F997-4261-4999-A6F1-0EBB34E9854F}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>Oreo.FilePackage</RootNamespace>
+    <AssemblyName>Oreo.FilePackage</AssemblyName>
+    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </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.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <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>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Fork.Net.Tools\Y.Utils\Y.Utils.csproj">
+      <Project>{5b8eeec7-aeb5-407d-9dc1-1c59e53f78d5}</Project>
+      <Name>Y.Utils</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 22 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Oreo.FilePackage
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 36 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Properties/AssemblyInfo.cs

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

+ 71 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Oreo.FilePackage.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("Oreo.FilePackage.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;
+            }
+        }
+    }
+}

+ 117 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Properties/Resources.resx

@@ -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>

+ 30 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Properties/Settings.Designer.cs

@@ -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 Oreo.FilePackage.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;
+            }
+        }
+    }
+}

+ 7 - 0
Fork.Net/Oreo.Plugins/Oreo.FilePackage/Properties/Settings.settings

@@ -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>