Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Person
- {
- // mezők , adattagok
- public string name;
- public string birthday;
- public string birthplace;
- // függvények, metódusok
- public
- }
- class vezerlo
- {
- List<Person> lista = new List<Person>();
- //fuggvenyek, metódusok
- public void beolvas()
- {
- StreamReader olvaso = new StreamReader("adatok.txt");
- while (!olvaso.EndOfStream)
- {
- string[] sor = olvaso.ReadLine().Split(',');
- Person szemely1 = new Person();
- szemely1.name = sor[0];
- szemely1.birthday = sor[1];
- szemely1.birthday = sor[2];
- lista.Add(szemely1);
- }
- }
- public void kiir()
- {
- foreach (var item in lista)
- {
- Console.WriteLine(item.name);
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- vezerlo vezerlo0 = new vezerlo();
- vezerlo0.beolvas();
- vezerlo0.kiir();
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment