Example #1
0
 public void Write(Student oStudent)
 {
     using (StreamWriter file = new StreamWriter(Path, true))
     {
         string szLine = FileCSVHelper.ParserStudentToCSVFormat(oStudent);
         file.Write(szLine);
     }
 }
Example #2
0
        public List <Student> Read(string szPath)
        {
            List <Student> oStudents = new List <Student>();

            using (StreamReader oFile = new StreamReader(szPath))
            {
                string szLine = oFile.ReadLine();
                while (!string.IsNullOrEmpty(szLine))
                {
                    oStudents.Add(FileCSVHelper.ParserCSVFormatToStudent(szLine));
                    szLine = oFile.ReadLine();
                }
            }
            return(oStudents);
        }