Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace ConsoleApp16
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- AddPerson();
- }
- }
- public static void AddPerson()
- {
- //List<string> names = new List<string>() { "Hector", "Basilis", "Mixalis" };
- //List<string> surnames = new List<string>() { "Gatsos", "Paspas", "Taspsa" };
- //List<string> salaries = new List<string>() { "50000", "3000", "4000" };
- //List<string> ages = new List<string>() { "33", "9", "65" };
- //List<string> content = new List<string>();
- string path = @"C:\Users\pclab\Desktop\mitsos" + 2 + ".txt";
- Console.WriteLine("Dose onoma");
- string name = Console.ReadLine();
- Console.WriteLine("Dose epitheto");
- string epitheto = Console.ReadLine();
- Console.WriteLine("Dose salary");
- string salary = Console.ReadLine();
- Console.WriteLine("Dose age");
- string age = Console.ReadLine();
- var content = string.Join(",", name, epitheto, salary, age);
- List<string> contents = new List<string>();
- contents.Add(content);
- //content = content + Environment.NewLine;
- File.AppendAllLines(path, contents);
- //pastebin.com/qXNKAMWs
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement