fix error

This commit is contained in:
dingxiaowei
2022-08-26 19:25:24 +08:00
parent 52f0c31497
commit 4059d7777c
12 changed files with 18 additions and 2 deletions
Binary file not shown.
Binary file not shown.
+1
View File
@@ -64,6 +64,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="avatarguideTest.cs" />
<Compile Include="ConsoleHelper.cs" /> <Compile Include="ConsoleHelper.cs" />
<Compile Include="CsvHelper.cs" /> <Compile Include="CsvHelper.cs" />
<Compile Include="ExcelHelper.cs" /> <Compile Include="ExcelHelper.cs" />
+2
View File
@@ -11,12 +11,14 @@ namespace ExcelTool
private List<TableExcelHeader> headers = new List<TableExcelHeader>(); private List<TableExcelHeader> headers = new List<TableExcelHeader>();
private List<TableExcelRow> rows = new List<TableExcelRow>(); private List<TableExcelRow> rows = new List<TableExcelRow>();
public int CollonCount = 0; public int CollonCount = 0;
public int RowCounts = 0;
public TableExcelData(IEnumerable<TableExcelHeader> headers, IEnumerable<TableExcelRow> rows) public TableExcelData(IEnumerable<TableExcelHeader> headers, IEnumerable<TableExcelRow> rows)
{ {
this.headers = headers.ToList(); this.headers = headers.ToList();
this.rows = rows.ToList(); this.rows = rows.ToList();
this.CollonCount = this.headers.Count; this.CollonCount = this.headers.Count;
this.RowCounts = this.rows.Count;
} }
public List<TableExcelHeader> Headers public List<TableExcelHeader> Headers
+1 -1
View File
@@ -19,7 +19,7 @@ namespace ExcelTool
//先写入行数,然后每一行的数据一次写入 小写类型、字符串 //先写入行数,然后每一行的数据一次写入 小写类型、字符串
List<Tuple<string, string>> datas = new List<Tuple<string, string>>(); List<Tuple<string, string>> datas = new List<Tuple<string, string>>();
var tableData = ExcelHelper.ExcelDatas(fileName); var tableData = ExcelHelper.ExcelDatas(fileName);
Tuple<string, string> rowCount = new Tuple<string, string>("int", tableData.CollonCount.ToString()); Tuple<string, string> rowCount = new Tuple<string, string>("int", tableData.RowCounts.ToString());
datas.Add(rowCount); datas.Add(rowCount);
foreach (var row in tableData.Rows) foreach (var row in tableData.Rows)
{ {
+13
View File
@@ -80,8 +80,21 @@ namespace ExcelTool
{ {
File.Delete(genExcels[i]); File.Delete(genExcels[i]);
} }
//读取测试
//IBinarySerializable newavList = new avatarguideTestConfig();
//var readOK = FileManager.ReadBinaryDataFromFile(Path.Combine(path, "avatarguideTest.bytes"), ref newavList);
//if (readOK)
//{
// ConsoleHelper.WriteInfoLine(newavList.ToString());
//}
//else
//{
// ConsoleHelper.WriteErrorLine("读取失败");
//}
Console.Read(); Console.Read();
} }
} }
} }
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.