Exemplo n.º 1
0
        /// <summary>
        /// 按年月提取动态数据表数据
        /// </summary>
        /// <param name="sYM"></param>
        /// <returns></returns>
        public static List <ItemDicLayerDataDynamic> readDicLayerData2struct(string sYM)
        {
            List <ItemDicLayerDataDynamic> ltReturn = new List <ItemDicLayerDataDynamic>();
            int    iLineIndex = 0;
            string filePath   = Path.Combine(cProjectManager.dirPathUsedProjectData, sYM + ".dym");

            if (File.Exists(filePath))
            {
                using (StreamReader sr = new StreamReader(filePath))
                {
                    String line;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        iLineIndex++;
                        //首行是headline
                        if (iLineIndex > 1)
                        {
                            ltReturn.Add(ItemDicLayerDataDynamic.parseLine(line));
                        }
                    }
                }
            }
            return(ltReturn);
        }