//读取输入射孔数据 public static List <ItemInputPerforate> readInputPerforation2Struct(string _sJH) { List <ItemInputPerforate> listInputPeforation = new List <ItemInputPerforate>(); int iLineIndex = 0; string inputFilePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameInputWellPerforation); if (File.Exists(inputFilePath)) { using (StreamReader sr = new StreamReader(inputFilePath)) { String line; while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0 { iLineIndex++; if (iLineIndex >= 1) { ItemInputPerforate item = ItemInputPerforate.parseLine(line); listInputPeforation.Add(item); } } } } return(listInputPeforation); }
static List <ItemInputPerforate> readInputFile(string _sJH) { List <ItemInputPerforate> listReturn = new List <ItemInputPerforate>(); string filePath = Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameInputWellPerforation); if (File.Exists(filePath)) { using (StreamReader sr = new StreamReader(filePath, Encoding.UTF8)) { String line; int iLine = 0; while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0 { iLine++; if (iLine > 0) { if (line.TrimEnd() != "") { ItemInputPerforate sttItem = ItemInputPerforate.parseLine(line); //如果射孔的时间小于目前系统存储的YM的最小值,更新系统年月 string sYMstart = sttItem.sYM; if (int.Parse(sYMstart) < int.Parse(cProjectData.ltStrProjectYM[0])) { cProjectData.setProjectYM(sYMstart); } if (sttItem.sJH != null) { listReturn.Add(sttItem); } } } } } } return(listReturn); }