Advertisement
Guest User

Skoliste.cs

a guest
Oct 29th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 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.  
  7. namespace Opgave7_1
  8. {
  9.     class Skoliste
  10.     {
  11.         public List<string> Sko1
  12.         {
  13.             get { return Fsko('1'); }
  14.         }
  15.         public List<string> Sko2
  16.         {
  17.             get { return Fsko('2'); }
  18.         }
  19.         public List<string> Sko3
  20.         {
  21.             get { return Fsko('3'); }
  22.         }
  23.  
  24.         public List<string> Fsko(char t)
  25.         {
  26.             List<string> list = new List<string>();
  27.             string sti = "sko" + t + ".txt";
  28.             string[] lines = System.IO.File.ReadAllLines(sti, Encoding.GetEncoding("iso-8859-1"));
  29.             foreach (string line in lines)
  30.             {
  31.                 list.Add(line);
  32.             }
  33.             return list;
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement