From 9211ec11c112e18cd99e77f889a01110a70031ce Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 24 十一月 2025 17:47:15 +0800
Subject: [PATCH] 优化项目结构

---
 HMI.Core/Util/SqliteHelper.cs |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/HMI.Core/Util/SqliteHelper.cs b/HMI.Core/Util/SqliteHelper.cs
index 34502b6..02c0dbb 100644
--- a/HMI.Core/Util/SqliteHelper.cs
+++ b/HMI.Core/Util/SqliteHelper.cs
@@ -1,15 +1,13 @@
 锘縰sing System;
 using System.Collections.Generic;
 using System.Data;
-using System.Data.Common;
-using System.Data.Odbc;
 using System.Data.SQLite;
 
 namespace HMI.Core.Util
 {
-    public class SqliteHelper
+    public class SqliteHelper:IDisposable
     {
-        private string DataBaseFile = string.Empty;
+        public string DataBaseFile { get; private set; } = string.Empty;
 
         private string ConnectString = string.Empty;
 
@@ -20,7 +18,7 @@
         public SqliteHelper(string DBFile)
         {
             DataBaseFile = DBFile;
-            ConnectString = "DataSource=" + DataBaseFile + ";Version=3;Pooling=False;Max Pool Size=100";
+            ConnectString = "DataSource=" + DataBaseFile + ";Version=3;Pooling=False;Max Pool Size=100;";
             conn = new SQLiteConnection(ConnectString);
             cmd = new SQLiteCommand(conn);
         }
@@ -188,7 +186,7 @@
             }
             catch (Exception ex)
             {
-                throw new Exception("鑾峰彇瀛楁鍚嶇О澶辫触:" + ex.Message);
+                throw new Exception("鑾峰彇琛ㄥ瓧娈靛悕绉板け璐�:" + ex.Message);
             }
         }
 
@@ -210,7 +208,7 @@
             }
             catch (Exception ex)
             {
-                throw new Exception("鑾峰彇瀛楁鍚嶇О澶辫触:" + ex.Message);
+                throw new Exception("鑾峰彇琛ㄥ悕澶辫触:" + ex.Message);
             }
         }
 
@@ -231,5 +229,10 @@
                 conn.Close();
             }
         }
+
+        public void Dispose()
+        {
+            this.Close();
+        }
     }
 }

--
Gitblit v1.9.1