示例#1
0
        public static List <ItemInputWellProduct> readProjectFile2Struct()
        {
            string filePath = Path.Combine(cProjectManager.dirPathUsedProjectData, cProjectManager.fileNameInputWellProduct);
            List <ItemInputWellProduct> listInputReturn = new List <ItemInputWellProduct>();
            int lineindex = 0;

            string[] split;
            if (File.Exists(filePath))
            {
                using (StreamReader sr = new StreamReader(filePath, Encoding.UTF8))
                {
                    String line;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        lineindex++;
                        split = line.Trim().Split(new char[] { ' ', '\t', ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
                        if (split.Length > 0 && lineindex >= 2)
                        {
                            ItemInputWellProduct item = ItemInputWellProduct.parseLine(line);
                            listInputReturn.Add(item);
                        }
                    }
                }
            }//end if
            return(listInputReturn);
        }
示例#2
0
        public static List <ItemInputWellProduct> readInput2Struct(string _sJH)
        {
            string filePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameInputWellProduct);
            List <ItemInputWellProduct> listInputReturn = new List <ItemInputWellProduct>();

            if (File.Exists(filePath))
            {
                List <string> ltLines = cIOBase.getListStrFromTextByFirstWord(filePath, _sJH);
                foreach (string line in ltLines)
                {
                    if (line.TrimEnd() != "")
                    {
                        ItemInputWellProduct item = ItemInputWellProduct.parseLine(line);
                        listInputReturn.Add(item);
                    }
                }
            }
            return(listInputReturn);
        }