Example #1
0
        static void Main(string[] args)
        {
            string filePath     = @"C:\Users\opilane\Samples";
            string fileName     = @"frozenl.txt";
            string fullFilePath = Path.Combine(filePath, fileName);

            string[] linesFromFile = File.ReadAllLines(fullFilePath);

            FrozenList Frozen = new FrozenList();

            foreach (string line in linesFromFile)
            {
                string[] tempArray  = line.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                string   frozenName = tempArray[0];
                string   frozenItem = tempArray[1];

                Console.WriteLine(frozenItem);



                Frozen.AddFrozenToList(frozenName, frozenItem);
            }

            Frozen.PrintAllFrozen();
        }
Example #2
0
        static void Main(string[] args)
        {
            string filePath     = @"C:\Users\opilane\samples";
            string fileName     = @"frozenl.txt";
            string fullFilePath = Path.Combine(filePath, fileName);

            string[]   linesFromFile = File.ReadAllLines(fullFilePath);
            FrozenList characters    = new FrozenList();

            foreach (string line in linesFromFile)
            {
                string[] tempArray     = line.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                string   characterName = tempArray[0];
                string   characterItem = tempArray[1];
                characters.AddCharactersToList(characterName, characterItem);
            }
            characters.PrintAllFrozens();
        }
Example #3
0
            static void Main(string[] args)
            {
                string filePath     = @"C:\Users\opilane\samples";
                string fileName     = @"Frozen.txt";
                string fullFilePath = Path.Combine(filePath, fileName);

                string[]   linesFromfile = File.ReadAllLines(fullFilePath);
                FrozenList myFrozens     = new FrozenList();

                foreach (string line in linesFromfile)
                {
                    string[] tempArray       = line.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                    string   frozenTitle     = tempArray[1];
                    string   frozenCharacter = tempArray[0];

                    myFrozens.AddFrozentoList(frozenTitle, frozenCharacter);
                }
                myFrozens.PrintAllFrozen();
            }
        static void Main(string[] args)
        {
            string filePath     = @"C:\Users\opilane\samples";
            string fileName     = @"frozenI.txt";
            string fullFilePath = Path.Combine(filePath, fileName);

            //create an arry of records from file
            string[] linesFromfile = File.ReadAllLines(fullFilePath);

            //create a list of movies to store the movie objects from file
            FrozenList myFrozens = new FrozenList();

            foreach (string line in linesFromfile)
            {
                //split the line to get the movie data
                string[] tempArry        = line.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                string   frozenTitle     = tempArry[1];
                string   frozenCharacter = tempArry[0];
                myFrozens.AddFrozenToList(frozenTitle, frozenCharacter);
            }
            myFrozens.PrintAllFrozen();
        }