Browse Source

improve the XmlResourceData.cs

cxs 3 years ago
parent
commit
54e87bc6fb
1 changed files with 3 additions and 1 deletions
  1. 3 1
      OTSIncAMeasureApp/0-OTSModel/OTSDataType/XmlResourceData.cs

+ 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;