Browse Source

Add FileExpander

HOME 3 years ago
parent
commit
341b379d09

+ 6 - 0
FileExpander/App.config

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

+ 85 - 0
FileExpander/FileExpander.csproj

@@ -0,0 +1,85 @@
+<?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>{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>FileExpander</RootNamespace>
+    <AssemblyName>FileExpander</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </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>
+    <LangVersion>latest</LangVersion>
+  </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>
+    <LangVersion>latest</LangVersion>
+  </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="FileExpanderForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FileExpanderForm.Designer.cs">
+      <DependentUpon>FileExpanderForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="FileExpanderForm.resx">
+      <DependentUpon>FileExpanderForm.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" />
+</Project>

+ 249 - 0
FileExpander/FileExpanderForm.Designer.cs

@@ -0,0 +1,249 @@
+
+namespace FileExpander
+{
+    partial class FileExpanderForm
+    {
+        /// <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.FileTextLabel = new System.Windows.Forms.Label();
+            this.FileValueLabel = new System.Windows.Forms.Label();
+            this.SelectButton = new System.Windows.Forms.Button();
+            this.DragDropLabel = new System.Windows.Forms.Label();
+            this.SizeTextLabel = new System.Windows.Forms.Label();
+            this.SizeValueLabel = new System.Windows.Forms.Label();
+            this.ExpandNumericUpDown = new System.Windows.Forms.NumericUpDown();
+            this.KbRadioButton = new System.Windows.Forms.RadioButton();
+            this.MbRadioButton = new System.Windows.Forms.RadioButton();
+            this.GbRadioButton = new System.Windows.Forms.RadioButton();
+            this.AfterExpandTextLabel = new System.Windows.Forms.Label();
+            this.AfterExpandValueLabel = new System.Windows.Forms.Label();
+            this.ExpandLabel = new System.Windows.Forms.Label();
+            this.GoButton = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.ExpandNumericUpDown)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // FileTextLabel
+            // 
+            this.FileTextLabel.AutoSize = true;
+            this.FileTextLabel.Location = new System.Drawing.Point(12, 9);
+            this.FileTextLabel.Name = "FileTextLabel";
+            this.FileTextLabel.Size = new System.Drawing.Size(35, 12);
+            this.FileTextLabel.TabIndex = 0;
+            this.FileTextLabel.Text = "File:";
+            // 
+            // FileValueLabel
+            // 
+            this.FileValueLabel.AllowDrop = true;
+            this.FileValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.FileValueLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.FileValueLabel.Location = new System.Drawing.Point(53, 8);
+            this.FileValueLabel.Name = "FileValueLabel";
+            this.FileValueLabel.Size = new System.Drawing.Size(230, 44);
+            this.FileValueLabel.TabIndex = 1;
+            this.FileValueLabel.Text = "- No Selected -";
+            this.FileValueLabel.DragDrop += new System.Windows.Forms.DragEventHandler(this.FileValueLabel_DragDrop);
+            this.FileValueLabel.DragEnter += new System.Windows.Forms.DragEventHandler(this.FileValueLabel_DragEnter);
+            // 
+            // SelectButton
+            // 
+            this.SelectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.SelectButton.Location = new System.Drawing.Point(289, 8);
+            this.SelectButton.Name = "SelectButton";
+            this.SelectButton.Size = new System.Drawing.Size(89, 23);
+            this.SelectButton.TabIndex = 2;
+            this.SelectButton.Text = "Select";
+            this.SelectButton.UseVisualStyleBackColor = true;
+            this.SelectButton.Click += new System.EventHandler(this.SelectButton_Click);
+            // 
+            // DragDropLabel
+            // 
+            this.DragDropLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.DragDropLabel.AutoSize = true;
+            this.DragDropLabel.Location = new System.Drawing.Point(289, 40);
+            this.DragDropLabel.Name = "DragDropLabel";
+            this.DragDropLabel.Size = new System.Drawing.Size(89, 12);
+            this.DragDropLabel.TabIndex = 0;
+            this.DragDropLabel.Text = "← Or DragDrop";
+            // 
+            // SizeTextLabel
+            // 
+            this.SizeTextLabel.AutoSize = true;
+            this.SizeTextLabel.Location = new System.Drawing.Point(14, 66);
+            this.SizeTextLabel.Name = "SizeTextLabel";
+            this.SizeTextLabel.Size = new System.Drawing.Size(35, 12);
+            this.SizeTextLabel.TabIndex = 3;
+            this.SizeTextLabel.Text = "Size:";
+            // 
+            // SizeValueLabel
+            // 
+            this.SizeValueLabel.AutoSize = true;
+            this.SizeValueLabel.Location = new System.Drawing.Point(55, 66);
+            this.SizeValueLabel.Name = "SizeValueLabel";
+            this.SizeValueLabel.Size = new System.Drawing.Size(125, 12);
+            this.SizeValueLabel.TabIndex = 3;
+            this.SizeValueLabel.Text = "- No File Selected -";
+            // 
+            // ExpandNumericUpDown
+            // 
+            this.ExpandNumericUpDown.Location = new System.Drawing.Point(66, 92);
+            this.ExpandNumericUpDown.Maximum = new decimal(new int[] {
+            1024,
+            0,
+            0,
+            0});
+            this.ExpandNumericUpDown.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.ExpandNumericUpDown.Name = "ExpandNumericUpDown";
+            this.ExpandNumericUpDown.Size = new System.Drawing.Size(44, 21);
+            this.ExpandNumericUpDown.TabIndex = 4;
+            this.ExpandNumericUpDown.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // KbRadioButton
+            // 
+            this.KbRadioButton.Location = new System.Drawing.Point(121, 92);
+            this.KbRadioButton.Name = "KbRadioButton";
+            this.KbRadioButton.Size = new System.Drawing.Size(40, 21);
+            this.KbRadioButton.TabIndex = 5;
+            this.KbRadioButton.TabStop = true;
+            this.KbRadioButton.Text = "KB";
+            this.KbRadioButton.UseVisualStyleBackColor = true;
+            this.KbRadioButton.CheckedChanged += new System.EventHandler(this.UnitRadioButton_CheckedChanged);
+            // 
+            // MbRadioButton
+            // 
+            this.MbRadioButton.Location = new System.Drawing.Point(167, 92);
+            this.MbRadioButton.Name = "MbRadioButton";
+            this.MbRadioButton.Size = new System.Drawing.Size(38, 21);
+            this.MbRadioButton.TabIndex = 5;
+            this.MbRadioButton.TabStop = true;
+            this.MbRadioButton.Text = "MB";
+            this.MbRadioButton.UseVisualStyleBackColor = true;
+            this.MbRadioButton.CheckedChanged += new System.EventHandler(this.UnitRadioButton_CheckedChanged);
+            // 
+            // GbRadioButton
+            // 
+            this.GbRadioButton.Location = new System.Drawing.Point(211, 92);
+            this.GbRadioButton.Name = "GbRadioButton";
+            this.GbRadioButton.Size = new System.Drawing.Size(42, 21);
+            this.GbRadioButton.TabIndex = 5;
+            this.GbRadioButton.TabStop = true;
+            this.GbRadioButton.Text = "GB";
+            this.GbRadioButton.UseVisualStyleBackColor = true;
+            this.GbRadioButton.CheckedChanged += new System.EventHandler(this.UnitRadioButton_CheckedChanged);
+            // 
+            // AfterExpandTextLabel
+            // 
+            this.AfterExpandTextLabel.AutoSize = true;
+            this.AfterExpandTextLabel.Location = new System.Drawing.Point(14, 126);
+            this.AfterExpandTextLabel.Name = "AfterExpandTextLabel";
+            this.AfterExpandTextLabel.Size = new System.Drawing.Size(41, 12);
+            this.AfterExpandTextLabel.TabIndex = 3;
+            this.AfterExpandTextLabel.Text = "After:";
+            // 
+            // AfterExpandValueLabel
+            // 
+            this.AfterExpandValueLabel.AutoSize = true;
+            this.AfterExpandValueLabel.Location = new System.Drawing.Point(61, 126);
+            this.AfterExpandValueLabel.Name = "AfterExpandValueLabel";
+            this.AfterExpandValueLabel.Size = new System.Drawing.Size(125, 12);
+            this.AfterExpandValueLabel.TabIndex = 3;
+            this.AfterExpandValueLabel.Text = "- No Unit Selected -";
+            // 
+            // ExpandLabel
+            // 
+            this.ExpandLabel.AutoSize = true;
+            this.ExpandLabel.Location = new System.Drawing.Point(12, 96);
+            this.ExpandLabel.Name = "ExpandLabel";
+            this.ExpandLabel.Size = new System.Drawing.Size(47, 12);
+            this.ExpandLabel.TabIndex = 3;
+            this.ExpandLabel.Text = "Expand:";
+            // 
+            // GoButton
+            // 
+            this.GoButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.GoButton.Location = new System.Drawing.Point(155, 149);
+            this.GoButton.Name = "GoButton";
+            this.GoButton.Size = new System.Drawing.Size(75, 23);
+            this.GoButton.TabIndex = 6;
+            this.GoButton.Text = "Go";
+            this.GoButton.UseVisualStyleBackColor = true;
+            this.GoButton.Click += new System.EventHandler(this.GoButton_Click);
+            // 
+            // FileExpanderForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(385, 184);
+            this.Controls.Add(this.GoButton);
+            this.Controls.Add(this.GbRadioButton);
+            this.Controls.Add(this.MbRadioButton);
+            this.Controls.Add(this.KbRadioButton);
+            this.Controls.Add(this.ExpandNumericUpDown);
+            this.Controls.Add(this.AfterExpandValueLabel);
+            this.Controls.Add(this.SizeValueLabel);
+            this.Controls.Add(this.ExpandLabel);
+            this.Controls.Add(this.AfterExpandTextLabel);
+            this.Controls.Add(this.SizeTextLabel);
+            this.Controls.Add(this.SelectButton);
+            this.Controls.Add(this.FileValueLabel);
+            this.Controls.Add(this.DragDropLabel);
+            this.Controls.Add(this.FileTextLabel);
+            this.Name = "FileExpanderForm";
+            this.Text = "File Expander";
+            ((System.ComponentModel.ISupportInitialize)(this.ExpandNumericUpDown)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label FileTextLabel;
+        private System.Windows.Forms.Label FileValueLabel;
+        private System.Windows.Forms.Button SelectButton;
+        private System.Windows.Forms.Label DragDropLabel;
+        private System.Windows.Forms.Label SizeTextLabel;
+        private System.Windows.Forms.Label SizeValueLabel;
+        private System.Windows.Forms.NumericUpDown ExpandNumericUpDown;
+        private System.Windows.Forms.RadioButton KbRadioButton;
+        private System.Windows.Forms.RadioButton MbRadioButton;
+        private System.Windows.Forms.RadioButton GbRadioButton;
+        private System.Windows.Forms.Label AfterExpandTextLabel;
+        private System.Windows.Forms.Label AfterExpandValueLabel;
+        private System.Windows.Forms.Label ExpandLabel;
+        private System.Windows.Forms.Button GoButton;
+    }
+}
+

+ 127 - 0
FileExpander/FileExpanderForm.cs

@@ -0,0 +1,127 @@
+using System;
+using System.IO;
+using System.Runtime.Remoting.Messaging;
+using System.Windows.Forms;
+using File = System.IO.File;
+
+namespace FileExpander
+{
+    public partial class FileExpanderForm : Form
+    {
+        private const int Kilobyte = 1024;
+        private const int Megabyte = Kilobyte * 1024;
+        private const int Gigabyte = Megabyte * 1024;
+
+        public FileExpanderForm() => InitializeComponent();
+
+        private void SelectButton_Click(object sender, EventArgs e)
+        {
+            using var dlg = new OpenFileDialog { Title = "Select file to expand", CheckFileExists = true };
+            if (dlg.ShowDialog() != DialogResult.OK) return;
+            FileValueLabel.Text = dlg.FileName;
+            UpdateDisplay();
+        }
+
+        private void FileValueLabel_DragEnter(object sender, DragEventArgs e)
+        {
+            e.Effect =
+                e.Data.GetDataPresent(DataFormats.FileDrop) && e.Data.GetData(DataFormats.FileDrop) is string[] arr && arr.Length == 1 && File.Exists(arr[0])
+                    ? DragDropEffects.Link
+                    : DragDropEffects.None;
+        }
+
+        private void FileValueLabel_DragDrop(object sender, DragEventArgs e)
+        {
+            FileValueLabel.Text = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
+            UpdateDisplay();
+        }
+
+        private void UnitRadioButton_CheckedChanged(object sender, EventArgs e)
+        {
+            var self = (RadioButton)sender;
+            if (self.Checked == false) return;
+            UpdateDisplay();
+        }
+
+        private void GoButton_Click(object sender, EventArgs e)
+        {
+            using var fs = new FileStream(FileValueLabel.Text, FileMode.Open, FileAccess.Write, FileShare.None);
+            fs.SetLength(fs.Length + GetExpand());
+            fs.Close();
+            MessageBox.Show("Success");
+            Close();
+        }
+
+        //---------------------------
+
+        private void UpdateDisplay()
+        {
+            var file = FileValueLabel.Text;
+            if (!File.Exists(file))
+            {
+                SizeValueLabel.Text = "⚠ No such file";
+                AfterExpandValueLabel.Text = "";
+                return;
+            }
+
+            long size;
+            try
+            {
+                //get real file size
+                using var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+                size = fs.Length;
+                fs.Close();
+            }
+            catch (Exception e)
+            {
+                SizeValueLabel.Text = "⚠ Failure to get file size:" + e.Message;
+                AfterExpandValueLabel.Text = "";
+                return;
+            }
+
+            SizeValueLabel.Text = HumanReadableSize(size) + $" ( {size:N0} bytes )";
+
+            var expand = GetExpand();
+
+            if (expand == -1)
+            {
+                AfterExpandValueLabel.Text = "- No Unit Selected -";
+            }
+            else
+            {
+                var final = size + expand;
+                AfterExpandValueLabel.Text = HumanReadableSize(final) + $" ( {final:N0} bytes )";
+            }
+        }
+
+        private long GetExpand()
+        {
+            long expand = -1;
+
+            if (KbRadioButton.Checked) expand = (long)ExpandNumericUpDown.Value * Kilobyte;
+            else if (MbRadioButton.Checked) expand = (long)ExpandNumericUpDown.Value * Megabyte;
+            else if (GbRadioButton.Checked) expand = (long)ExpandNumericUpDown.Value * Gigabyte;
+
+            return expand;
+        }
+
+        private static string HumanReadableSize(long size)
+        {
+            var sizes = new[] { "B", "KB", "MB", "GB", "TB" };
+            double len = size;
+            var order = 0;
+            while (len >= 1024 && order < sizes.Length - 1)
+            {
+                order++;
+                len /= 1024;
+            }
+
+            // Adjust the format string to your preferences. For example "{0:0.#}{1}" would
+            // show a single decimal place, and no space.
+            var result = String.Format("{0:0.##} {1}", len, sizes[order]);
+            return result;
+        }
+
+
+    }
+}

+ 120 - 0
FileExpander/FileExpanderForm.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>

+ 22 - 0
FileExpander/Program.cs

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

+ 36 - 0
FileExpander/Properties/AssemblyInfo.cs

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

+ 70 - 0
FileExpander/Properties/Resources.Designer.cs

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

+ 29 - 0
FileExpander/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <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 FileExpander.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
FileExpander/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>

+ 6 - 0
StrangeTools.sln

@@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "@", "@", "{8E093C14-C04A-45
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileNameCharsetConvert", "FileNameCharsetConvert\FileNameCharsetConvert.csproj", "{CE26341A-CE0B-4B1C-97A5-BA7E8A9ACFDD}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileExpander", "FileExpander\FileExpander.csproj", "{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -26,6 +28,10 @@ Global
 		{CE26341A-CE0B-4B1C-97A5-BA7E8A9ACFDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CE26341A-CE0B-4B1C-97A5-BA7E8A9ACFDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CE26341A-CE0B-4B1C-97A5-BA7E8A9ACFDD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7A3E4609-7FDD-4CE9-8671-82F7049F51B0}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE