From 559890c482f5973f06aafdfec9550fee5ba3c7f2 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 17:02:15 +0800
Subject: [PATCH] feat: CAN 模拟器 TCP 化 + 多设备并发调试 + 后台生命周期管理

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