Engine发教程 - 图文 下载本文

return null;

}

if (!System.IO.File.Exists(surveyDataFullName)) {

MessageBox.Show(\野外测量数据不存在!\

return null; }

string strLine;

char[] charArray = new char[] {','};

string[] strArray;

System.IO.FileStream aFile = new System.IO.FileStream(surveyDataFullName, FileMode.Open);

StreamReader sr = new StreamReader(aFile,Encoding.Default);

strLine = sr.ReadLine();

strArray = strLine.Split(charArray);

if (strArray.Length > 0) {

for (int x = 0; x < strArray.Length; x++) {

pColumns.Add(strArray[x]); } }

else {

return null; }

strLine = sr.ReadLine();

while (strLine != null) {

strArray = strLine.Split(charArray);

CPoint pCPoint= new CPoint();

pCPoint.x = Convert.ToDouble(strArray[0]);

pCPoint.y = Convert.ToDouble(strArray[1]);

pCPoint.name = strArray[2].Trim();

pList.Add(pCPoint);

strLine = sr.ReadLine(); }

sr.Close();

return pList; }

catch (Exception Err) {

MessageBox.Show(Err.Message);

return null;