All pastes #2104246 Raw Edit

Stuff

public text v1 · immutable
#2104246 ·published 2012-01-20 02:45 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace txtReader
{
    class testing
    {
        public void readFile()
        {
            Elevator elevator = new Elevator();
            List<Array> list = new List<Array>();
            int i = 0;
            foreach (string line in File.ReadAllLines(@"C:\MyFolder\sample1.txt"))
            {
                if (i == 0)
                {
                    elevator.noFloor = Convert.ToInt32(line);
                    Console.WriteLine("eto un" + " " + elevator.noFloor);
                }
                else
                {
                    string[] parts = line.Split(',');
                    list.Add(parts);
                    for (int j = 0; j < list.ElementAt(i - 1).Length; j++)
                    {
                        if (i == 1)
                        {
                            elevator.elevCapacity = list.ElementAt(i - 1).GetValue(j); 
                        }
                        Console.Write("{0} ", list.ElementAt(i - 1).GetValue(j));
                    }
                    Console.WriteLine();
                }
                i++;

            }
            Console.ReadKey();
        }
    }
}