领胜LDS 键盘AOI检测项目
xcd
2020-07-14 6ca2f993973295e4da82634761da0e5c00e0ef8e
Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071
11个文件已添加
7个文件已修改
926 ■■■■■ 已修改文件
M071.sln 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.DBManager/Bro.M071.DBManager.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.DBManager/ExcelExportHelper.cs 171 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.DBManager/packages.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Model/Model/KeyUnitData.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Model/Model/MeasurementUnitResult.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/M071Process.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/App.config 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/ExcelTest.csproj 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Form1.Designer.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Form1.cs 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Form1.resx 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Program.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Properties/AssemblyInfo.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Properties/Resources.Designer.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Properties/Resources.resx 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Properties/Settings.Designer.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/ExcelTest/Properties/Settings.settings 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
M071.sln
@@ -33,6 +33,8 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bro.M071.DBManager", "src\Bro.M071.DBManager\Bro.M071.DBManager.csproj", "{230B0FFF-F6AF-45FE-AAF7-B4B66250DD58}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelTest", "src\ExcelTest\ExcelTest.csproj", "{A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
@@ -215,6 +217,18 @@
        {230B0FFF-F6AF-45FE-AAF7-B4B66250DD58}.Release|Any CPU.Build.0 = Release|Any CPU
        {230B0FFF-F6AF-45FE-AAF7-B4B66250DD58}.Release|x64.ActiveCfg = Release|x64
        {230B0FFF-F6AF-45FE-AAF7-B4B66250DD58}.Release|x64.Build.0 = Release|x64
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug|x64.ActiveCfg = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug|x64.Build.0 = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug1|Any CPU.ActiveCfg = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug1|Any CPU.Build.0 = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug1|x64.ActiveCfg = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Debug1|x64.Build.0 = Debug|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Release|Any CPU.Build.0 = Release|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Release|x64.ActiveCfg = Release|Any CPU
        {A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}.Release|x64.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
src/Bro.M071.DBManager/Bro.M071.DBManager.csproj
@@ -80,8 +80,8 @@
    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <HintPath>..\..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
    </Reference>
    <Reference Include="EPPlus, Version=5.2.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
      <HintPath>..\..\packages\EPPlus.5.2.0\lib\net45\EPPlus.dll</HintPath>
    <Reference Include="EPPlus, Version=4.5.3.3, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
      <HintPath>..\..\packages\EPPlus.4.5.3.3\lib\net40\EPPlus.dll</HintPath>
    </Reference>
    <Reference Include="PresentationCore" />
    <Reference Include="SQLite.CodeFirst, Version=1.5.3.29, Culture=neutral, PublicKeyToken=eb96ba0a78d831a7, processorArchitecture=MSIL">
src/Bro.M071.DBManager/ExcelExportHelper.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Linq;
namespace Bro.M071.DBManager
@@ -18,6 +19,13 @@
        /// </summary>
        public Dictionary<string, Dictionary<string, string>> WorksheetColumns { get; set; }
        public Dictionary<string, DataTable> WorksheetDataTable { get; set; }
        public ExcelExportSet()
        {
            Worksheets = new List<string>();
            WorksheetColumns = new Dictionary<string, Dictionary<string, string>>();
            WorksheetDataTable = new Dictionary<string, DataTable>();
        }
    }
@@ -70,6 +78,7 @@
        /// <returns></returns>
        public static byte[] ExportExcel(ExcelExportSet excelExportDto, bool showSrNo = false)
        {
            //ExcelPackage.LicenseContext = LicenseContext.Commercial; 5.0以上版本 需要授权
            byte[] result = null;
            using (ExcelPackage package = new ExcelPackage())
            {
@@ -77,7 +86,8 @@
                {
                    var dataTable = excelExportDto.WorksheetDataTable[worksheet];
                    ExcelWorksheet workSheet = package.Workbook.Worksheets.Add($"{worksheet}");
                    int startRowFrom = string.IsNullOrEmpty(worksheet) ? 1 : 3;  //开始的行
                    //int startRowFrom = string.IsNullOrEmpty(worksheet) ? 1 : 3;  //开始的行
                    int startRowFrom = 1;  //开始的行
                                                                                 //是否显示行编号
                    if (showSrNo)
                    {
@@ -92,19 +102,28 @@
                    }
                    //Add Content Into the Excel File
                    workSheet.Cells["A" + startRowFrom].LoadFromDataTable(dataTable, true);
                    // autofit width of cells with small content
                    int columnIndex = 1;
                    foreach (DataColumn item in dataTable.Columns)
                    for (int columnIndex = 1; columnIndex <= dataTable.Columns.Count; columnIndex++)
                    {
                        // autofit width of cells with small content
                        ExcelRange columnCells = workSheet.Cells[workSheet.Dimension.Start.Row, columnIndex, workSheet.Dimension.End.Row, columnIndex];
                        int maxLength = columnCells.Max(cell => cell.Value.ToString().Count());
                        if (maxLength < 150)
                        {
                            workSheet.Column(columnIndex).AutoFit();
                        }
                        columnIndex++;
                        // 设置NG单元格样式
                        for (int rowIndex = 1; rowIndex <= dataTable.Rows.Count; rowIndex++)
                        {
                            if (columnCells[rowIndex, columnIndex].Text == "NG")
                            {
                                workSheet.Cells[rowIndex, columnIndex].Style.Font.Bold = true;//字体为粗体
                                workSheet.Cells[rowIndex, columnIndex].Style.Fill.PatternType = ExcelFillStyle.Solid;
                                workSheet.Cells[rowIndex, columnIndex].Style.Fill.BackgroundColor.SetColor(System.Drawing.ColorTranslator.FromHtml("#E33E33"));// 设置填充样式
                    }
                    // format header - bold, yellow on black
                        }
                    }
                    // format header - bold, yellow on black 设置表头样式
                    using (ExcelRange r = workSheet.Cells[startRowFrom, 1, startRowFrom, dataTable.Columns.Count])
                    {
                        r.Style.Font.Color.SetColor(System.Drawing.Color.White);
@@ -124,34 +143,128 @@
                        r.Style.Border.Left.Color.SetColor(System.Drawing.Color.Black);
                        r.Style.Border.Right.Color.SetColor(System.Drawing.Color.Black);
                    }
                    if (!string.IsNullOrEmpty(worksheet))
                    {
                        workSheet.Cells["A1"].Value = worksheet;
                        workSheet.Cells["A1"].Style.Font.Size = 20;
                        workSheet.InsertColumn(1, 1);
                        workSheet.InsertRow(1, 1);
                        workSheet.Column(1).Width = 5;
                    //将sheet写入表中
                    //if (!string.IsNullOrEmpty(worksheet))
                    //{
                    //    workSheet.Cells["A1"].Value = worksheet;
                    //    workSheet.Cells["A1"].Style.Font.Size = 20;
                    //    workSheet.InsertColumn(1, 1);
                    //    workSheet.InsertRow(1, 1);
                    //    workSheet.Column(1).Width = 5;
                    //}
                    }
                    result = package.GetAsByteArray();
                }
            }
            return result;
        }
        ///// <summary>
        ///// 导出Excel
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="data"></param>
        ///// <param name="heading"></param>
        ///// <param name="isShowSlNo"></param>
        ///// <param name="columnsToTake"></param>
        ///// <returns></returns>
        //public static byte[] ExportExcel<T>(List<T> data, string heading = "", bool isShowSlNo = false, params string[] columnsToTake)
        //{
        //    ExcelExportSet excelExport = new ExcelExportSet();
        //    excelExport.
        //    return ExportExcel(ListToDataTable(data), heading, isShowSlNo, columnsToTake);
        //}
        /// <summary>
        /// 新建 或 追加 写入Excel
        /// </summary>
        /// <param name="excelExportDto"></param>
        /// <param name="fileName">要写入的文件名(全路径名)</param>
        /// <param name="showSrNo"></param>
        /// <returns></returns>
        public static byte[] CreateOrAppendExcel(ExcelExportSet excelExportDto, string fileName, bool showSrNo = false)
        {
            byte[] result = null;
            bool isExist = File.Exists(fileName);
            ExcelExportSet newExcelSet = new ExcelExportSet();
            if (isExist)
            {
                var oldWorksheetDataTable = WorksheetToTable(fileName, excelExportDto.Worksheets);
                newExcelSet.Worksheets = excelExportDto.Worksheets;
                newExcelSet.WorksheetColumns = excelExportDto.WorksheetColumns;
                foreach (var sheet in excelExportDto.Worksheets)
                {
                    var oldTable = oldWorksheetDataTable[sheet];
                    newExcelSet.WorksheetDataTable[sheet] = oldTable;
                    if (excelExportDto.WorksheetDataTable[sheet].Rows.Count > 0)
                    {
                        //合并两个 datatable
                        newExcelSet.WorksheetDataTable[sheet].Merge(excelExportDto.WorksheetDataTable[sheet]);
                    }
                }
            }
            else
            {
                newExcelSet = excelExportDto;
            }
            result = ExportExcel(newExcelSet, showSrNo);
            return result;
        }
        /// <summary>
        ///将指定的Excel的文件转换成DataTable (Excel的指定sheet)
        /// </summary>
        /// <param name="fullFielPath">文件的绝对路径</param>
        /// <returns></returns>
        public static Dictionary<string, DataTable> WorksheetToTable(string fullFielPath, List<string> worksheets)
        {
            try
            {
                var resultWorksheetDataTable = new Dictionary<string, DataTable>();
                FileInfo existingFile = new FileInfo(fullFielPath);
                ExcelPackage package = new ExcelPackage(existingFile);
                foreach (var sheet in worksheets)
                {
                    ExcelWorksheet worksheet = package.Workbook.Worksheets[sheet];//选定 指定页
                    var dataTable = WorksheetToTable(worksheet);
                    resultWorksheetDataTable[sheet] = dataTable;
                }
                return resultWorksheetDataTable;
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// 将worksheet转成datatable
        /// </summary>
        /// <param name="worksheet">待处理的worksheet</param>
        /// <returns>返回处理后的datatable</returns>
        public static DataTable WorksheetToTable(ExcelWorksheet worksheet)
        {
            //获取worksheet的行数
            int rows = worksheet.Dimension.End.Row;
            //获取worksheet的列数
            int cols = worksheet.Dimension.End.Column;
            DataTable dt = new DataTable(worksheet.Name);
            DataRow dr = null;
            for (int i = 1; i <= rows; i++)
            {
                if (i > 1)
                    dr = dt.Rows.Add();
                for (int j = 1; j <= cols; j++)
                {
                    //默认将第一行设置为datatable的标题
                    if (i == 1)
                        dt.Columns.Add(GetString(worksheet.Cells[i, j].Value));
                    //剩下的写入datatable
                    else
                        dr[j - 1] = GetString(worksheet.Cells[i, j].Value);
                }
            }
            return dt;
        }
        private static string GetString(object obj)
        {
            try
            {
                return obj.ToString();
            }
            catch (Exception)
            {
                return "";
            }
        }
    }
}
src/Bro.M071.DBManager/packages.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.4.0" targetFramework="net452" />
  <package id="EPPlus" version="5.2.0" targetFramework="net452" />
  <package id="EPPlus" version="4.5.3.3" targetFramework="net452" />
  <package id="SQLite.CodeFirst" version="1.5.3.29" targetFramework="net452" />
  <package id="System.Data.SQLite" version="1.0.112.0" targetFramework="net452" />
  <package id="System.Data.SQLite.Core" version="1.0.112.0" targetFramework="net452" />
src/Bro.M071.Model/Model/KeyUnitData.cs
@@ -1,6 +1,7 @@

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Bro.M071.Model.Model
{
@@ -32,6 +33,9 @@
        /// </summary>
        [StringLength(64)]
        public string ItemValue { get; set; }
        [NotMapped]
        public string ProductionBarcode { get; set; }
    }
    public class KeyUnitDataRequest : BaseRequest
src/Bro.M071.Model/Model/MeasurementUnitResult.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Bro.M071.Model.Model
{
@@ -39,6 +40,9 @@
        /// </summary>
        [StringLength(64)]
        public string MeasurementResult { get; set; }
        [NotMapped]
        public string ProductionBarcode { get; set; }
    }
    public class MeasurementUnitResultRequest : BaseRequest
src/Bro.M071.Process/M071Process.cs
@@ -414,8 +414,8 @@
                {
                }
                ////Excel报表输出 (单个产品的excel导出)
                //ExportProductionExcel(measurementUnitResultAndKeyUnitDataSet);
                //Excel报表输出 (单个产品的excel导出)
                ExportProductionExcel(measurementUnitResultAndKeyUnitDataSet);
                ////数据库保存 
                //SaveProductionData(measurementUnitResultAndKeyUnitDataSet);
@@ -489,18 +489,19 @@
                measurementUnitResultAndKeyUnitDataSet.ProductionMeasurementRecord = productionMeasurementRecords;
                foreach (var MeasurementUnitResult in pData.Measurements)//获取到单个测量项结果
                foreach (var measurementUnit in pData.Measurements)//获取到单个测量项结果
                {
                    MeasurementUnitResult measurementUnitResult = new MeasurementUnitResult();
                    measurementUnitResult.ProductionMeasurementRecordsId = productionMeasurementRecords.ID;
                    measurementUnitResult.MeasurementName = MeasurementUnitResult.Name;
                    measurementUnitResult.MeasurementType = MeasurementUnitResult.MeasureType;
                    measurementUnitResult.MeasurementValue = MeasurementUnitResult.Spec.ActualValue.ToString();
                    measurementUnitResult.MeasurementResult = MeasurementUnitResult.Spec.MeasureResult.Value ? "OK" : "NG";
                    measurementUnitResult.ProductionBarcode = productionMeasurementRecords.ProductionBarcode;
                    measurementUnitResult.MeasurementName = measurementUnit.Name;
                    measurementUnitResult.MeasurementType = measurementUnit.MeasureType;
                    measurementUnitResult.MeasurementValue = measurementUnit.Spec.ActualValue.ToString();
                    measurementUnitResult.MeasurementResult = measurementUnit.Spec.MeasureResult.Value ? "OK" : "NG";
                    measurementUnitResults.Add(measurementUnitResult);
                    foreach (var keyUnit in MeasurementUnitResult.KeyUnitCollection)//获取单个键的测量结果
                    foreach (var keyUnit in measurementUnit.KeyUnitCollection)//获取单个键的测量结果
                    {
                        foreach (var keyValue in keyUnit.MeasureValueDict)//获取单个键的单个测量item 结果
                        {
@@ -508,6 +509,7 @@
                            if (!isExist)//已存在 不重复添加原始数据
                            {
                                KeyUnitData keyUnitData = new KeyUnitData();
                                keyUnitData.ProductionBarcode = productionMeasurementRecords.ProductionBarcode;
                                keyUnitData.Key = keyUnit.Key;
                                keyUnitData.MeasurementItem = keyValue.Key;
                                keyUnitData.ItemValue = keyValue.Value.ToString();
@@ -544,12 +546,14 @@
                excelExportDto.Worksheets = new List<string>() { "原始数据", "检测结果" };
                var keyUnitColumns = new Dictionary<string, string>()
                {
                    {"ProductionBarcode", "产品条码"},
                    {"Key", "键"},
                    {"MeasurementItem", "检测项"},
                    {"ItemValue", "检测值"}
                };
                var measurementUnitResultColumns = new Dictionary<string, string>()
                {
                    {"ProductionBarcode", "产品条码"},
                    {"MeasurementName", "检测名称"},
                    {"MeasurementType", "检测类型"},
                    {"MeasurementValue", "检测值"},
@@ -561,14 +565,14 @@
                excelExportDto.WorksheetDataTable[excelExportDto.Worksheets[0]] = ExcelExportHelper.ListToDataTable(measurementUnitResultAndKeyUnitDataSet.KeyUnitDataList, keyUnitColumns);
                excelExportDto.WorksheetDataTable[excelExportDto.Worksheets[1]] = ExcelExportHelper.ListToDataTable(measurementUnitResultAndKeyUnitDataSet.MeasurementUnitResultList, measurementUnitResultColumns); ;
                byte[] filecontent = ExcelExportHelper.ExportExcel(excelExportDto, false);
                string dir = Path.Combine(Config.LogPath, DateTime.Now.ToString("yyyyMMdd"));
                if (!Directory.Exists(dir))
                if (!Directory.Exists(Config.LogPath))
                {
                    Directory.CreateDirectory(dir);
                    Directory.CreateDirectory(Config.LogPath);
                }
                var fileName = Path.Combine(Config.LogPath, $"ProductionData_{DateTime.Now.ToString("yyyyMMdd")}.xlsx");
                FileStream fs = new FileStream(Path.Combine(dir, $"{measurementUnitResultAndKeyUnitDataSet.ProductionMeasurementRecord.ProductionBarcode}_{DateTime.Now.ToString("HHmmss")}.xlsx"), FileMode.Create, FileAccess.Write);
                byte[] filecontent = ExcelExportHelper.CreateOrAppendExcel(excelExportDto, fileName);
                FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
                fs.Write(filecontent, 0, filecontent.Length);
                fs.Flush();
                fs.Close();
src/ExcelTest/App.config
New file
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.112.0" newVersion="1.0.112.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Data.SQLite.EF6" publicKeyToken="db937bc2d44ff139" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.112.0" newVersion="1.0.112.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
src/ExcelTest/ExcelTest.csproj
New file
@@ -0,0 +1,93 @@
<?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>{A6600DBD-1DFC-4BE3-9ED9-51104E9232A0}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <RootNamespace>ExcelTest</RootNamespace>
    <AssemblyName>ExcelTest</AssemblyName>
    <TargetFrameworkVersion>v4.5.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>
  </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="..\Bro.M071.DBManager\Bro.M071.DBManager.csproj">
      <Project>{230B0FFF-F6AF-45FE-AAF7-B4B66250DD58}</Project>
      <Name>Bro.M071.DBManager</Name>
    </ProjectReference>
    <ProjectReference Include="..\Bro.M071.Model\Bro.M071.Model.csproj">
      <Project>{AD645C48-5811-4B1E-B81F-D35D5E6B577F}</Project>
      <Name>Bro.M071.Model</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
src/ExcelTest/Form1.Designer.cs
New file
@@ -0,0 +1,61 @@
namespace ExcelTest
{
    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.button1 = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(105, 98);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);
        }
        #endregion
        private System.Windows.Forms.Button button1;
    }
}
src/ExcelTest/Form1.cs
New file
@@ -0,0 +1,122 @@
using Bro.M071.DBManager;
using Bro.M071.Model.Model;
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;
namespace ExcelTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SaveExcel();
            //SaveTxt();
        }
        public async void SaveExcel()
        {
            //if (!Config.IsCSVOutputEnabled)
            //    return;
            await Task.Run(() =>
            {
                var measurementUnitResultAndKeyUnitDataSet = new ProductionMeasurementUnitResultAndKeyUnitDataSet();
                measurementUnitResultAndKeyUnitDataSet.KeyUnitDataList = new List<KeyUnitData>();
                measurementUnitResultAndKeyUnitDataSet.MeasurementUnitResultList = new List<MeasurementUnitResult>();
                for (int i = 0; i < 10; i++)
                {
                    KeyUnitData keyUnitData = new KeyUnitData();
                    keyUnitData.Key = "A" + i;
                    keyUnitData.MeasurementItem = "Z" + i;
                    keyUnitData.ItemValue = (i / 10).ToString();
                    measurementUnitResultAndKeyUnitDataSet.KeyUnitDataList.Add(keyUnitData);
                    MeasurementUnitResult measurementUnitResult = new MeasurementUnitResult();
                    measurementUnitResult.ProductionMeasurementRecordsId = Guid.NewGuid().ToString();
                    measurementUnitResult.MeasurementName = "测试" + i;
                    measurementUnitResult.MeasurementType = "Slant";
                    measurementUnitResult.MeasurementValue = (i + 10).ToString();
                    measurementUnitResult.MeasurementResult = (i % 2) == 1? "OK":"NG";
                    measurementUnitResultAndKeyUnitDataSet.MeasurementUnitResultList.Add(measurementUnitResult);
                }
                ExcelExportSet excelExportDto = new ExcelExportSet();
                excelExportDto.Worksheets = new List<string>() { "原始数据", "检测结果" };
                var keyUnitColumns = new Dictionary<string, string>()
                {
                    {"Key", "键"},
                    {"MeasurementItem", "检测项"},
                    {"ItemValue", "检测值"}
                };
                var measurementUnitResultColumns = new Dictionary<string, string>()
                {
                    {"MeasurementName", "检测名称"},
                    {"MeasurementType", "检测类型"},
                    {"MeasurementValue", "检测值"},
                    {"MeasurementResult", "检测结果"},
                };
                excelExportDto.WorksheetColumns[excelExportDto.Worksheets[0]] = keyUnitColumns;
                excelExportDto.WorksheetColumns[excelExportDto.Worksheets[1]] = measurementUnitResultColumns;
                excelExportDto.WorksheetDataTable[excelExportDto.Worksheets[0]] = ExcelExportHelper.ListToDataTable(measurementUnitResultAndKeyUnitDataSet.KeyUnitDataList, keyUnitColumns);
                excelExportDto.WorksheetDataTable[excelExportDto.Worksheets[1]] = ExcelExportHelper.ListToDataTable(measurementUnitResultAndKeyUnitDataSet.MeasurementUnitResultList, measurementUnitResultColumns); ;
                string dir = Path.Combine(@"D:\PROJECTS\M071", DateTime.Now.ToString("yyyyMMdd"));
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
                var fileName = Path.Combine(dir, $"test_133536.xlsx");
                byte[] filecontent = ExcelExportHelper.CreateOrAppendExcel(excelExportDto, fileName);
                FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
                fs.Write(filecontent, 0, filecontent.Length);
                fs.Flush();
                fs.Close();
            });
        }
        public void SaveTxt()
        {
            FileStream fs = null;
            string filePath = "D:\\file1.txt";
            //将待写的入数据从字符串转换为字节数组
            Encoding encoder = Encoding.UTF8;
            byte[] bytes = encoder.GetBytes("Hello World! \n\r");
            try
            {
                //fs = File.OpenWrite(filePath);
                ////设定书写的开始位置为文件的末尾
                //fs.Position = fs.Length;
                fs = File.Open(filePath, FileMode.Append, FileAccess.Write);
                //将待写入内容追加到文件末尾
                fs.Write(bytes, 0, bytes.Length);
            }
            catch (Exception ex)
            {
                Console.WriteLine("文件打开失败{0}", ex.ToString());
            }
            finally
            {
                fs.Close();
            }
        }
    }
}
src/ExcelTest/Form1.resx
New file
@@ -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>
src/ExcelTest/Program.cs
New file
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ExcelTest
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
src/ExcelTest/Properties/AssemblyInfo.cs
New file
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ExcelTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExcelTest")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a6600dbd-1dfc-4be3-9ed9-51104e9232a0")]
// 程序集的版本信息由下列四个值组成:
//
//      主版本
//      次版本
//      生成号
//      修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
src/ExcelTest/Properties/Resources.Designer.cs
New file
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本: 4.0.30319.42000
//
//     对此文件的更改可能导致不正确的行为,如果
//     重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ExcelTest.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("ExcelTest.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;
            }
        }
    }
}
src/ExcelTest/Properties/Resources.resx
New file
@@ -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>
src/ExcelTest/Properties/Settings.Designer.cs
New file
@@ -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 ExcelTest.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;
            }
        }
    }
}
src/ExcelTest/Properties/Settings.settings
New file
@@ -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>