Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 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 kviz
  9. {
  10. struct Kviz
  11. {
  12. public string kerdesek;
  13. public string Kerdesek
  14. {
  15. get { return kerdesek; }
  16. }
  17. public string valaszok;
  18. public string Valaszok
  19. {
  20. get { return valaszok; }
  21. }
  22.  
  23. public Kviz(string kerdesek, string valaszok)
  24. {
  25. this.kerdesek = kerdesek;
  26. this.valaszok = valaszok;
  27. }
  28.  
  29. }
  30. class Program
  31. {
  32. static List<Kviz> Tori;
  33. static string asd;
  34. static void Main(string[] args)
  35. {
  36. Tori = new List<Kviz>();
  37. StreamReader sr = new StreamReader("tori.txt", Encoding.UTF8);
  38. asd = sr.ReadLine();
  39. while (!sr.EndOfStream)
  40. {
  41. string[] sor = sr.ReadLine().Split('\t');
  42. Kviz asdasd = new Kviz() { kerdesek = sor[0], valaszok = sor[1] };
  43. Tori.Add(asdasd);
  44. }
  45. sr.Close();
  46. Console.WriteLine(Tori[0].kerdesek);
  47. Console.WriteLine(Tori[0].valaszok);
  48. Console.ReadLine();
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement