From b544d5cccd76735e034c8055918a50927b437474 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期二, 10 十一月 2026 08:29:04 +0800
Subject: [PATCH] fix: 维护模式重复进入失败与按钮灰死 + Broker 并发验证用例
---
HMI.Util/ExcelHelper.cs | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/HMI.Util/ExcelHelper.cs b/HMI.Util/ExcelHelper.cs
index 0708a5c..801b657 100644
--- a/HMI.Util/ExcelHelper.cs
+++ b/HMI.Util/ExcelHelper.cs
@@ -104,6 +104,36 @@
}
}
+ public static void ExportExcel(string targetPath, List<string[]> rows)
+ {
+ IWorkbook workbook = null;
+ if (targetPath.EndsWith(".xlsx"))
+ {
+ workbook = new XSSFWorkbook();
+ }
+ else if (targetPath.EndsWith(".xls"))
+ {
+ workbook = new HSSFWorkbook();
+ }
+ workbook.CreateSheet("sheet1");////鏂板缓涓�涓伐浣滆〃
+ ISheet SheetOne = workbook.GetSheet("sheet1");
+
+
+ for (int i = 0; i < rows.Count; i++)
+ {
+ IRow rowTemp = SheetOne.CreateRow(i);
+ for (int j = 0; j < rows[i].Length; j++)
+ {
+ rowTemp.CreateCell(j).SetCellValue(rows[i][j]);
+ }
+ }
+
+ using (FileStream fs = new FileStream(targetPath, FileMode.OpenOrCreate))
+ {
+ workbook.Write(fs);
+ }
+ }
+
public static List<T> ReadFromExcel<T>(string sourcePath)
{
--
Gitblit v1.9.1