yhluo 2 päivää sitten
vanhempi
commit
cb1156cb9e
1 muutettua tiedostoa jossa 22 lisäystä ja 14 poistoa
  1. 22 14
      UAS_MES_YTDZ/FunctionCode/Make/Make_ParseLog.cs

+ 22 - 14
UAS_MES_YTDZ/FunctionCode/Make/Make_ParseLog.cs

@@ -380,32 +380,41 @@ namespace UAS_MES_NEW.Make
                         string ok = Path.Combine(file, "OK");
                         string ok = Path.Combine(file, "OK");
                         string ng = Path.Combine(file, "NG");
                         string ng = Path.Combine(file, "NG");
                         string na = Path.Combine(file, "NA");
                         string na = Path.Combine(file, "NA");
-                        string[] okPath = Directory.GetDirectories(ok);
-                        string[] ngPath = Directory.GetDirectories(ng);
-                        string[] naPath = Directory.GetDirectories(na);
 
 
                         List<string> pathList = new List<string> { };
                         List<string> pathList = new List<string> { };
-                        if(okPath.Length > 0)
+                        if (Directory.Exists(ok))
                         {
                         {
-                            foreach(string item in okPath)
+                            string[] okPath = Directory.GetDirectories(ok);
+                            if (okPath.Length > 0)
                             {
                             {
-                                pathList.Add(item);
+                                foreach (string item in okPath)
+                                {
+                                    pathList.Add(item);
+                                }
                             }
                             }
                         }
                         }
-                        
-                        if(ngPath.Length > 0)
+
+                        if (Directory.Exists(ng))
                         {
                         {
-                            foreach (string item in ngPath)
+                            string[] ngPath = Directory.GetDirectories(ng);
+                            if (ngPath.Length > 0)
                             {
                             {
-                                pathList.Add(item);
+                                foreach (string item in ngPath)
+                                {
+                                    pathList.Add(item);
+                                }
                             }
                             }
                         }
                         }
 
 
-                        if (naPath.Length > 0)
+                        if (Directory.Exists(na))
                         {
                         {
-                            foreach (string item in naPath)
+                            string[] naPath = Directory.GetDirectories(na);
+                            if (naPath.Length > 0)
                             {
                             {
-                                pathList.Add(item);
+                                foreach (string item in naPath)
+                                {
+                                    pathList.Add(item);
+                                }
                             }
                             }
                         }
                         }
                         
                         
@@ -438,7 +447,6 @@ namespace UAS_MES_NEW.Make
                             }
                             }
                         }
                         }
 
 
-
                         string newFloderName = Path.GetDirectoryName(file);
                         string newFloderName = Path.GetDirectoryName(file);
                         Directory.Move(file, Path.Combine(newFloderName, "Log_" + Path.GetFileName(file)));
                         Directory.Move(file, Path.Combine(newFloderName, "Log_" + Path.GetFileName(file)));
                     }
                     }