Ejemplo n.º 1
0
        public static bool checkPreviousFEMM()
        {
            try
            {
                // FEMM 설치 메인 디렉토리를 얻어낸다.
                string strFEMMDirName = Path.GetDirectoryName(CSettingData.m_strFemmExeFileFullName);
                strFEMMDirName = strFEMMDirName.Remove(strFEMMDirName.IndexOf("bin"));

                // readme.txt 의 첫 줄을 읽어낸다.
                string strReadmeFileFullName = Path.Combine(strFEMMDirName, "readme.txt");

                CReadFile readFile       = new CReadFile();
                string    strVersionFEMM = readFile.getLine(strReadmeFileFullName, 1);      // 내용 : FEMM 4.2 12Jan2016

                // readme.txt 에서 FEMM 4.2 버전의 Build 날짜를 읽어낸다.
                char[]   separators = { ' ' };
                string[] strArray;
                strArray = strVersionFEMM.Split(separators, StringSplitOptions.None);
                string strVersionDate = strArray[2];                                        // 내용 : 12Jan2016

                if (strVersionDate.Length < 9)
                {
                    CNotice.printLogID("TWAP4");
                    return(false);
                }

                DateTime currentDataTime = new DateTime();
                DateTime limitDataTime   = new DateTime();

                limitDataTime   = Convert.ToDateTime("24Sep2017");
                currentDataTime = Convert.ToDateTime(strVersionDate);

                // 24Sep2017 보다 이전 버전이면 true 를 리턴한다.
                if (currentDataTime < limitDataTime)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }
        }