Procházet zdrojové kódy

improve the XmlResourceData.cs

cxs před 3 roky
rodič
revize
54e87bc6fb

+ 3 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/XmlResourceData.cs

@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.IO;
+using System.Windows.Forms;
 using System.Xml;
 
 namespace OTSDataType
@@ -90,7 +91,8 @@ namespace OTSDataType
         public bool LoadStringFromXml()
         {
             XmlDocument xml = new XmlDocument();
-            if (!Directory.Exists(".\\Resources\\XMLData\\LanguageDefine.xml"))
+            string path= Application.StartupPath + @"\Resources\XMLData\LanguageDefine.xml";
+            if (!File.Exists(path))
             {
                 NLog.LogManager.GetCurrentClassLogger().Error("There's no \\Resources\\XMLData\\LanguageDefine.xml");
                 return false;