浏览代码

代码调整

章政 8 年之前
父节点
当前提交
5341344367
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      UAS_XmlAnalysor/Form1.cs

+ 10 - 2
UAS_XmlAnalysor/Form1.cs

@@ -17,8 +17,14 @@ namespace UAS_XmlAnalysor
         DataTable dt;
 
         Thread InitDB;
-
-        string CachePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/Cache/Cache.xml";
+        /// <summary>
+        /// 缓存的文件
+        /// </summary>
+        string CachePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/Cache.xml";
+        /// <summary>
+        /// 缓存的文件夹
+        /// </summary>
+        string CachePathFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/";
 
         public Form1()
         {
@@ -43,6 +49,8 @@ namespace UAS_XmlAnalysor
             Master.ValueMember = "ma_user";
             try
             {
+                if (!Directory.Exists(CachePathFolder))
+                    Directory.CreateDirectory(CachePathFolder);
                 XmlReader myReader = XmlReader.Create(CachePath);
                 while (myReader.Read())
                 {