Exemple #1
0
        private static void Task01()
        {
            Console.Write("Ieraksti faila nosaukumu: ");
            String name = Console.ReadLine();

            FileOperations.Read(name);
        }
Exemple #2
0
        private static void Task04()
        {
            List <String> myList   = new List <String>();
            int           whatToDo = 0;

            do
            {
                Console.Write("Lūdzu izvēlieties darbību (1- pievienot elementu, 2- izvadīt Listu, 3- iziet : ");
                whatToDo = InputNumberBetween("", 1, 3);
                switch (whatToDo)
                {
                case 1:
                    Console.Write("Ievadiet List elementu: ");
                    FileOperations.Write("Test", Console.ReadLine());
                    break;

                case 2:
                    Console.WriteLine();
                    myList = FileOperations.Read("Test");
                    if (myList.Count == 0)
                    {
                        Console.WriteLine("Lists ir tukšs");
                    }
                    else
                    {
                        Console.WriteLine(string.Join(", ", myList));
                    }
                    Console.WriteLine();
                    break;
                }
            } while (whatToDo != 3);
        }
Exemple #3
0
        private static void Task02()
        {
            List <String> lst = new List <String>()
            {
                "Ābols", "Burkāns", "Tomāts", "Redīs", "Gurķis", "Biete", "Kartupelis"
            };

            //FileOperations.Write("Test", lst);
            FileOperations.Read("Test");
        }
Exemple #4
0
        private static void Task03()
        {
            List <String> lst    = new List <String>();
            List <String> newLst = new List <String>();

            lst = FileOperations.Read("Test");
            for (int i = lst.Count - 1; i > -1; i--)
            {
                newLst.Add(lst[i]);
            }
            //FileOperations.Write("new", newLst );
        }
Exemple #5
0
        static void Task02()
        {
            Console.WriteLine("Enter file name: ");
            String name = Console.ReadLine();

            List <String> List = new List <String> {
                "da", "fse", "gwg"
            };

            FileOperations.Write(List, name);

            FileOperations.Read(name);
        }
Exemple #6
0
        private static void sampleFileOperations()
        {
            //FileOperations.Write();

            FileOperations.Read("Test");
        }