From 54d918939c9f05e7588beb571cb49675433fc93d Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 15 三月 2023 17:04:19 +0800
Subject: [PATCH] 1

---
 ExportMap/cs/Tool.cs |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ExportMap/cs/Tool.cs b/ExportMap/cs/Tool.cs
index d997eb5..a365eea 100644
--- a/ExportMap/cs/Tool.cs
+++ b/ExportMap/cs/Tool.cs
@@ -23,6 +23,22 @@
         /// </summary>
         public static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory;
 
+        private static string tempDir;
+
+        public static string TempDir
+        {
+            get
+            {
+                if (string.IsNullOrWhiteSpace(tempDir))
+                {
+                    tempDir = Path.Combine(BaseDir, "temp");
+                    if (!Directory.Exists(tempDir)) Directory.CreateDirectory(tempDir);
+                }
+
+                return tempDir;
+            }
+        }
+
         private static PostgreHelper _dbHelper;
 
         /// <summary>
@@ -162,10 +178,7 @@
 
                 LogOut.Info("cmd = " + cmd);
                 si.AutoFlush = true;
-                if (isPy)
-                {
-                    si.WriteLine("\"C:\\Program Files\\QGIS 3.16\\bin\\python-qgis-ltr.bat\"");
-                }
+                if (isPy) si.WriteLine("\"C:\\Program Files\\QGIS 3.16\\bin\\python-qgis-ltr.bat\"");
                 si.WriteLine(cmd);
                 si.WriteLine("exit");
 

--
Gitblit v1.9.3