Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace ConsoleApp16
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14.  
  15. while (true)
  16. {
  17. AddPerson();
  18. }
  19.  
  20. }
  21.  
  22. public static void AddPerson()
  23. {
  24.  
  25. //List<string> names = new List<string>() { "Hector", "Basilis", "Mixalis" };
  26. //List<string> surnames = new List<string>() { "Gatsos", "Paspas", "Taspsa" };
  27. //List<string> salaries = new List<string>() { "50000", "3000", "4000" };
  28. //List<string> ages = new List<string>() { "33", "9", "65" };
  29. //List<string> content = new List<string>();
  30.  
  31.  
  32.  
  33. string path = @"C:\Users\pclab\Desktop\mitsos" + 2 + ".txt";
  34. Console.WriteLine("Dose onoma");
  35. string name = Console.ReadLine();
  36.  
  37. Console.WriteLine("Dose epitheto");
  38. string epitheto = Console.ReadLine();
  39.  
  40. Console.WriteLine("Dose salary");
  41. string salary = Console.ReadLine();
  42.  
  43. Console.WriteLine("Dose age");
  44. string age = Console.ReadLine();
  45.  
  46. var content = string.Join(",", name, epitheto, salary, age);
  47. List<string> contents = new List<string>();
  48. contents.Add(content);
  49. //content = content + Environment.NewLine;
  50. File.AppendAllLines(path, contents);
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. //pastebin.com/qXNKAMWs
  65.  
  66.  
  67. }
  68.  
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement