From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
Plugin.TestResult/CSVPrinter.cs | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/Plugin.TestResult/CSVPrinter.cs b/Plugin.TestResult/CSVPrinter.cs
new file mode 100644
index 0000000..6cb631b
--- /dev/null
+++ b/Plugin.TestResult/CSVPrinter.cs
@@ -0,0 +1,44 @@
+锘縰sing System.IO;
+using System.Text;
+
+namespace CSVHelper
+{
+ public class CSVPrinter
+ {
+ public static void Print(string dir, string fileName, string title, string line)
+ {
+ EnsureDirectoryExists(dir);
+ string path = Path.Combine(dir, fileName);
+ lock (path)
+ {
+ if (!File.Exists(path))
+ {
+ using (var fs = File.Create(path))
+ using (var writer = new StreamWriter(fs, Encoding.UTF8))
+ {
+ writer.WriteLine(title);
+ writer.WriteLine(line);
+ writer.Flush();
+ }
+ }
+ else
+ {
+ using (var fs = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
+ using (var writer = new StreamWriter(fs, Encoding.UTF8))
+ {
+ writer.WriteLine(line);
+ writer.Flush();
+ }
+ }
+ }
+ }
+
+ private static void EnsureDirectoryExists(string logDir)
+ {
+ if (!Directory.Exists(logDir))
+ {
+ Directory.CreateDirectory(logDir);
+ }
+ }
+ }
+}
--
Gitblit v1.9.1