Ejemplo n.º 1
0
        /// <summary>
        /// Gets all information about locations from the database
        /// </summary>
        /// <returns>a list of found locations</returns>
        public List <tblLocation> GetAllLocations()
        {
            ReadWriteFile      rwf  = new ReadWriteFile();
            List <tblLocation> list = new List <tblLocation>();

            try
            {
                using (WorkerContext context = new WorkerContext())
                {
                    list = (from x in context.tblLocations select x).OrderBy(x => x.LocationAddress).ToList();

                    // If the location list is empty
                    if (!list.Any())
                    {
                        rwf.ReadLocationFromFile(list);
                    }

                    return(list);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception" + ex.Message.ToString());
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Read a file of forbidden words and check the text
        /// for them.
        /// Check for empty string.
        /// </summary>
        /// <param name="value"></param>
        public static void ValidateComment(string value)
        {
            var words = value
                        .Trim()
                        .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                        .ToList();

            if (!(0 < words.Count && words.Count <= 200))
            {
                throw new ArgumentException("Comment must be between 0 and 200 words");
            }

            foreach (var word in words)
            {
                CheckForLettersAndDigits(word);
                CheckWordLength(word);
            }

            var forbidden = ReadWriteFile.ReadForbiddenWordsFromFile();

            foreach (var word in forbidden)
            {
                var check = words.Where(current => current == word).Count();
                if (check > 0)
                {
                    throw new ArgumentException("Using inappropriate language");
                }
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> LoadFromText()
        {
            string            jsonString = ReadWriteFile.ReadTextAsJson(@"g:\covertext.txt");
            List <CoverModel> CoverList  = JsonConvert.DeserializeObject <List <CoverModel> >(jsonString);
            List <CastModel>  CastList   = new List <CastModel>();

            foreach (var cover in CoverList)
            {
                CastModel cast = new CastModel();
                cast.firstname = cover.cast;
                cast.lastname  = cover.filename;
                CastList.Add(cast);
            }
            // Sort CastList
            //List<CastModel> sortedCastList = CastList.OrderBy(x => x.firstname.ToLower()).ToList();
            List <CastModel> sortedCastList = CastList;

            // Clear DBSet
            doruContext.CastSet.RemoveRange(doruContext.CastSet);

            foreach (var cast in sortedCastList)
            {
                doruContext.CastSet.Add(cast);
            }
            await doruContext.SaveChangesAsync();

            return(NoContent());
        }
Ejemplo n.º 4
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog();
            dialog.FileName   = "Document";                    // Default file name
            dialog.DefaultExt = "text";                        // Default file extension
            dialog.Filter     = "Text documents (.txt)|*.txt"; // Filter files by extension

            Nullable <bool> result = dialog.ShowDialog();

            if (result == true)
            {
                try
                {
                    var newItems = ReadWriteFile.ReadFile(dialog.FileName);

                    InputDataGrid.Matches.Clear();

                    foreach (var item in newItems)
                    {
                        InputDataGrid.Matches.Add(item);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message);
                }
            }
        }
Ejemplo n.º 5
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     if (ReadWriteFile.CurrentFile != null)
     {
         try
         {
             ReadWriteFile.SaveFile(InputDataGrid.Matches, ReadWriteFile.CurrentFile);
         }
         catch (ArgumentException ex)
         {
             if (ex.ParamName == "AwayTeam")
             {
                 MessageBox.Show("Грешка: невалидна стойност на отбора гост");
             }
             else if (ex.ParamName == "HomeTeam")
             {
                 MessageBox.Show("Грешка: невалидна стойност на отбора домакин");
             }
             else
             {
                 MessageBox.Show("Грешка: " + ex.Message);
             }
         }
         catch (Exception ex)
         {
             // TODO: develop translating method for future releases
             MessageBox.Show("Грешка: " + ex.Message);
         }
     }
     else
     {
         SaveAs_Click(sender, e);
     }
 }
Ejemplo n.º 6
0
        public async Task <ActionResult> ReparseCoverFilename()
        {
            try
            {
                CoverModel        updateCover;
                List <CoverModel> allCover = doruDB.Cover.ToList();
                ReadWriteFile.ParseCoverFilename(allCover);

                foreach (var cover in allCover)
                {
                    //var cover = await doruDB.Cover.FindAsync(id);
                    updateCover = await doruDB.Cover.FindAsync(cover.Id);

                    updateCover = cover;
                    doruDB.Cover.Update(updateCover);
                }
                await doruDB.SaveChangesAsync();

                return(NoContent());
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 7
0
        static void Main()
        {
            string filePath = @"..\..\TestFile.txt";


            List <Game> TestList = new List <Game>()
            {
                new Football(3, Countries.France, DateTime.Now, new Match("team", "other team")),
                new Volleyball(3, Countries.France, DateTime.Now, new Match("team", "other team")),
                new Tennis(3, Countries.France, DateTime.Now, new Match("team", "other team")),
                new Football(3, Countries.France, DateTime.Now, new Match("team", "other team")),
            };

            TestList.SaveFile(filePath);

            TestList = null;

            var newList = ReadWriteFile.ReadFile(filePath);

            foreach (var item in newList)
            {
                Console.WriteLine(item);
            }



            Console.ReadLine();
        }
Ejemplo n.º 8
0
        private ReadWriteFile MakeParser()
        {
            string         path          = "mypath.csv";
            IFileProcessor fileProcessor = new ProcessorStub(path);
            ReadWriteFile  readWriteFile = new ReadWriteFile(fileProcessor);

            return(readWriteFile);
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> SaveCast()
        {
            string jsonString = JsonConvert.SerializeObject(doruContext.CastSet);

            ReadWriteFile.WriteJson(jsonString, @"g:\Cast.json");

            return(NoContent());
        }
Ejemplo n.º 10
0
        public void IsValidFileName_EmptyFile_Throws()
        {
            ReadWriteFile readWriteFile = MakeParser();

            var ex = Assert.Catch <Exception>(() => readWriteFile.IsValidFileName(""));

            StringAssert.Contains("File is required", ex.Message);
        }
Ejemplo n.º 11
0
        public async Task <IActionResult> SaveToCoverJson()
        {
            string jsonString = JsonConvert.SerializeObject(doruDB.Cover);

            ReadWriteFile.WriteJson(jsonString, @"g:\cover.json");

            return(NoContent());
        }
Ejemplo n.º 12
0
        private void Window_KeyDown_1(object sender, KeyEventArgs e)
        {
            if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.O)
            {
                String oldFile = nowFilePath;
                System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog();
                openFileDialog.Filter          = "文本文件|*.txt|所有文件|*.*";
                openFileDialog.ValidateNames   = true;
                openFileDialog.CheckPathExists = true;
                openFileDialog.CheckFileExists = true;
                if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    nowFilePath = openFileDialog.FileName;
                }
                if (oldFile != nowFilePath)
                {
                    ReadWriteFile rwFile = new ReadWriteFile();
                    //nowFile Save
                    rwFile.writeFile(oldFile, this.text_edit.Text, false);

                    //newFile read
                    this.text_edit.Text = rwFile.readFileStr(nowFilePath, false);

                    this.text_edit.Focus();
                    //设置光标的位置到文本尾
                    this.text_edit.Select(this.text_edit.Text.Length, 0);
                    //滚动到最后
                    this.text_edit.ScrollToEnd();
                }

                e.Handled = true;
            }
            else if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S)
            {
                //nowFile Save
                if (nowFilePath != "")
                {
                    ReadWriteFile rwFile = new ReadWriteFile();
                    rwFile.writeFile(nowFilePath, this.text_edit.Text, false);
                }

                e.Handled = true;
            }
            else if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.Q)
            {
                if (nowFilePath != "")
                {
                    ReadWriteFile rwFile = new ReadWriteFile();
                    rwFile.writeFile(nowFilePath, this.text_edit.Text, false);
                }
                this.Close();
            }
            else if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.H)
            {
                MessageBox.Show("CTRL+O  打开\nCTRL+S  保存\nCTRL+Q  退出\nCTRL+H  帮助");
            }
        }
Ejemplo n.º 13
0
        static void Main()
        {
            Console.WriteLine("teste");
            string cmd = Console.ReadLine();

            IReadWriteFile readWrite = new ReadWriteFile();
            String         ret       = "Log file save at:" + readWrite.Inicialize(cmd);

            Console.WriteLine(ret);
        }
Ejemplo n.º 14
0
        public void IsValidFileName_ValidExtensions_ReturnsTrue(string file, bool expected)
        {
            //Arrange
            ReadWriteFile readWriteFile = MakeParser();

            //Act
            bool result = readWriteFile.IsValidFileName(file);

            //Assert
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 15
0
        public void GetNames_WhenCalled_Returns_ListOfStringNames()
        {
            //Arrange
            List <string> expected      = new List <string>();
            ReadWriteFile readWriteFile = MakeParser();

            //Act
            List <string> actual = readWriteFile.GetNames();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 16
0
        public void SorterTest()
        {
            Sorter n = new Sorter("unittest.txt");

            n.SetResultFileName("unittestsorted.txt");
            n.SortName();

            ReadWriteFile read    = new ReadWriteFile();
            List <string> correct = read.ReadFileToList("sortedtest.txt");
            List <string> test    = read.ReadFileToList("unittestsorted.txt");

            Assert.AreEqual(correct, test);
        }
        public void If_LogToObj_IsOk()
        {
            //ARRANGE
            String      cmd = "convert https://s3.amazonaws.com/uux-itaas-static/minha-cdn-logs/input-01.txt ./output/minhaCdn1.txt";
            ServiceTest svc = new ServiceTest();

            // ACT
            IReadWriteFile service     = new ReadWriteFile();
            String         docPathSave = service.Inicialize(cmd);
            string         text        = File.ReadAllText(@docPathSave);

            // ASSERT
            Assert.AreEqual(text, svc.GenerateFinalLog().ToString());
        }
Ejemplo n.º 18
0
        public async Task <IActionResult> ImportMedicamentos([FromServices] ITDeveloperDbContext context)
        {
            var filePath = ImportUtils.GetFilePath("Csv", "Medicamentos", ".CSV"); // DELEGUEI

            /// Não importa para esta classe saber como é implementada a leitura e gravação - DELEGUEI
            ReadWriteFile rwf = new ReadWriteFile();

            if (!await rwf.ReadAndWriteCsvAsync(filePath, context))
            {
                return(View("JaTemMedicamento", context.Medicamento.AsNoTracking().OrderBy(o => o.Codigo)));
            }

            return(View("ListaMedicamentos", context.Medicamento.AsNoTracking().OrderBy(o => o.Codigo)));
        }
Ejemplo n.º 19
0
        public ShowViewModel(IDialogService dialogService)
        {
            db = new ParkingdbContext();

            dbSize = db.Parks.Count();

            Parks = new ObservableCollection <ParkingInfo>();

            Cache     = new Caching <ParkingInfo>();
            CacheList = new ObservableCollection <ParkingInfo>();

            Favorites = JConvert <ObservableCollection <ParkingInfo> > .Deser(ReadWriteFile <ObservableCollection <ParkingInfo> > .Read("Favorites.json", true))
                        ?? new ObservableCollection <ParkingInfo>();

            this.dialogService = dialogService;
        }
Ejemplo n.º 20
0
        public async Task <IActionResult> LoadCast()
        {
            string           jsonString = ReadWriteFile.ReadJson(@"g:\Cast.json");
            List <CastModel> CastList   = JsonConvert.DeserializeObject <List <CastModel> >(jsonString);

            // Clear DBSet
            doruContext.CastSet.RemoveRange(doruContext.CastSet);

            foreach (var Cast in CastList)
            {
                doruContext.CastSet.Add(Cast);
            }
            await doruContext.SaveChangesAsync();

            return(NoContent());
        }
Ejemplo n.º 21
0
        public async Task <IActionResult> LoadFromText()
        {
            string            jsonString = ReadWriteFile.ReadTextAsJson(@"g:\covertext.txt");
            List <CoverModel> CoverList  = JsonConvert.DeserializeObject <List <CoverModel> >(jsonString);
            // Sort CoverList
            //List<CoverModel> sortedCoverList = CoverList.OrderBy(x => x.series.ToLower()).ToList();
            List <CoverModel> sortedCoverList = CoverList;

            // Clear DBSet
            doruContext.CoverSet.RemoveRange(doruContext.CoverSet);

            foreach (var cover in sortedCoverList)
            {
                doruContext.CoverSet.Add(cover);
            }
            await doruContext.SaveChangesAsync();

            return(NoContent());
        }
Ejemplo n.º 22
0
        public void OrderNames_WhenCalled_ReturnsListOfitemsOrderByCountDescendingAndAlphabeticallyAscending()
        {
            //Arrange
            string        path     = "mypath.csv";
            List <string> expected = new List <string>()
            {
                "Smith, 2", "Clive, 2", "Owen, 2", "James, 2", "Brown, 2", "Graham, 2", "Howe, 2", "Jimmy, 1", "John, 1"
            };
            List <string> items = new List <string>()
            {
                "Jimmy", "Smith", "Clive", "Owen", "James", "Brown", "Graham", "Howe", "John", "Howe", "Clive", "Smith", "James", "Owen", "Graham", "Brown"
            };
            ReadWriteFile readWriteFile = MakeParser();

            //Act
            List <string> actual = readWriteFile.OrderNames(items);

            //Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 23
0
        public async Task <IActionResult> LoadCover()
        {
            string            jsonString = ReadWriteFile.ReadTextAsJson(@"g:\cover.json");
            List <CoverModel> coverList  = JsonConvert.DeserializeObject <List <CoverModel> >(jsonString);

            while (doruContext.CoverSet.Count() > 0)
            {
                var cover = doruContext.CoverSet.First();
                doruContext.CoverSet.Remove(cover);
                await doruContext.SaveChangesAsync();
            }

            foreach (var cover in coverList)
            {
                doruContext.CoverSet.Add(cover);
                await doruContext.SaveChangesAsync();
            }

            return(NoContent());
        }
Ejemplo n.º 24
0
        public async Task <IActionResult> UploadFromCoverTextFile()
        {
            string            jsonString = ReadWriteFile.ReadTextAsJson(@"g:\covertext.txt");
            List <CoverModel> CoverList  = JsonConvert.DeserializeObject <List <CoverModel> >(jsonString);
            // Sort CoverList
            //List<CoverModel> sortedCoverList = CoverList.OrderBy(x => x.series.ToLower()).ToList();
            List <CoverModel> sortedCoverList = CoverList;

            //// Clear DBSet
            //doruDB.Cover.RemoveRange(doruDB.Cover);
            // build a dictionary of key: filename and value: id
            // build a list of not existed CoverModel by comparing to dictionary
            // add not existed CoverModel to dbcontext

            foreach (var cover in sortedCoverList)
            {
                doruDB.Cover.Add(cover);
            }
            await doruDB.SaveChangesAsync();

            return(NoContent());
        }
Ejemplo n.º 25
0
        private void SaveAs_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
            dialog.FileName   = "Document";                    // Default file name
            dialog.DefaultExt = "text";                        // Default file extension
            dialog.Filter     = "Text documents (.txt)|*.txt"; // Filter files by extension

            Nullable <bool> result = dialog.ShowDialog();

            if (result == true)
            {
                try
                {
                    ReadWriteFile.SaveFile(InputDataGrid.Matches, dialog.FileName);
                }
                catch (ArgumentException ex)
                {
                    if (ex.ParamName == "AwayTeam")
                    {
                        MessageBox.Show("Грешка: невалидна стойност на отбора гост");
                    }
                    else if (ex.ParamName == "HomeTeam")
                    {
                        MessageBox.Show("Грешка: невалидна стойност на отбора домакин");
                    }
                    else
                    {
                        MessageBox.Show("Грешка: " + ex.Message);
                    }
                }
                catch (Exception ex)
                {
                    // TODO: develop translating method for future releases
                    MessageBox.Show("Грешка: " + ex.Message);
                }
            }
        }
Ejemplo n.º 26
0
        public void WriteTest()
        {
            ReadWriteFile write = new ReadWriteFile();

            write.WriteListToFile("write.txt", testList);
        }
Ejemplo n.º 27
0
        private static void WorkWithOneFile()
        {
            Console.WriteLine("1 - Зашифровать один файл\n");
            Console.WriteLine("2 - Расшифровать один файл\n");
            string selection = Console.ReadLine();

            string path;

            switch (selection)
            {
            case "1":
                using (Aes myAes = Aes.Create())
                {
                    Console.WriteLine("Введите полное имя файла(с указанием пути)");
                    path = Console.ReadLine();
                    CheckPath.СhekedPathToFile(ref path);

                    byte[] encrypted;
                    try
                    {
                        if (ReadWriteFile.ReadFile(path).Length != 0)
                        {
                            // Encrypt the string to an array of bytes.
                            encrypted = CifherAes.EncryptBytes_Aes(ReadWriteFile.ReadFile(path),
                                                                   myAes.Key,
                                                                   myAes.IV);
                            ReadWriteFile.WriteFile(path, encrypted);
                        }
                        else
                        {
                            Console.WriteLine("файл " + path + "пустой ");
                        }

                        Console.WriteLine("\nВведите полное имя файла для хранения ключа (с указанием пути)");
                        path = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref path);
                        ReadWriteFile.WriteFile(path, myAes.Key);
                        Console.WriteLine("Ключ  ");
                        foreach (var value in myAes.Key)
                        {
                            Console.Write(value);
                        }
                        Console.WriteLine();

                        Console.WriteLine("Введите полное имя файла для хранения вектора инициаизации  (с указанием пути)");
                        path = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref path);
                        ReadWriteFile.WriteFile(path, myAes.IV);
                        Console.WriteLine("Вектор инициализации {0}");
                        foreach (var value in myAes.IV)
                        {
                            Console.Write(value);
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                }
                break;

            case "2":
                Console.WriteLine("Введите полное имя файла(с указанием пути)");
                path = Console.ReadLine();
                CheckPath.СhekedPathToFile(ref path);

                byte[] decripted;
                try
                {
                    Console.WriteLine("Введите полное имя ключа(с указанием пути)");
                    string pathToKey = Console.ReadLine();
                    CheckPath.СhekedPathToFile(ref path);
                    Console.WriteLine("Ключ  ");
                    foreach (var value in ReadWriteFile.ReadFile(pathToKey))
                    {
                        Console.Write(value);
                    }

                    Console.WriteLine();

                    Console.WriteLine("Введите полное имя вектора инициализации (с указанием пути)");
                    string pathToIV = Console.ReadLine();
                    CheckPath.СhekedPathToFile(ref path);
                    foreach (var value in ReadWriteFile.ReadFile(pathToIV))
                    {
                        Console.Write(value);
                    }

                    // Encrypt the string to an array of bytes.
                    if (ReadWriteFile.ReadFile(path).Length != 0)
                    {
                        decripted = CifherAes.DecryptBytes_Aes(ReadWriteFile.ReadFile(path),
                                                               ReadWriteFile.ReadFile(pathToKey),
                                                               ReadWriteFile.ReadFile(pathToIV));

                        ReadWriteFile.WriteFile(path, decripted);
                    }
                    else
                    {
                        Console.WriteLine("файл " + path + "пустой. с ним нельзя работать");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                break;

            default:
                Console.WriteLine("Вы нажали неизвестную букву");
                break;
            }
        }
Ejemplo n.º 28
0
        private static void WorkWithFolderOrDisk()
        {
            Console.Clear();

            Console.WriteLine("1 - Зашифровать папку или диск\n");
            Console.WriteLine("Помниет что ключ и вектор инициализации хранить отдельно от пути объекта шифрации");
            Console.WriteLine("2 - Расшифровать папку или диск\n");
            string selection = Console.ReadLine();

            switch (selection)
            {
            case "1":
                using (Aes myAes = Aes.Create())
                {
                    Console.WriteLine("Введите полное имя папки(с указанием пути)");
                    string path = Console.ReadLine();
                    CheckPath.СhekedPathToDirectory(ref path);

                    byte[] encrypted;
                    try
                    {
                        foreach (var i in GettFiles.LookIn(path))
                        {
                            Console.WriteLine(i);
                            // Encrypt the string to an array of bytes.
                            if (ReadWriteFile.ReadFile(i).Length != 0)
                            {
                                encrypted = CifherAes.EncryptBytes_Aes(ReadWriteFile.ReadFile(i), myAes.Key, myAes.IV);
                                ReadWriteFile.WriteFile(i, encrypted);
                            }
                            else
                            {
                                Console.WriteLine("файл " + i + " пустой");
                            }
                        }
                        GettFiles.LookIn(path).Clear();

                        Console.WriteLine("\nВведите полное имя файла для хранения ключа (с указанием пути)");
                        path = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref path);

                        ReadWriteFile.WriteFile(path, myAes.Key);
                        Console.WriteLine("Ключ  ");
                        foreach (var value in myAes.Key)
                        {
                            Console.Write(value);
                        }
                        Console.WriteLine();

                        Console.WriteLine("Введите полное имя файла для хранения вектора инициаизации  (с указанием пути)");
                        path = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref path);
                        ReadWriteFile.WriteFile(path, myAes.IV);
                        Console.WriteLine("Вектор инициализации {0}");
                        foreach (var value in myAes.IV)
                        {
                            Console.Write(value);
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                }

                break;

            case "2":
                using (Aes myAes = Aes.Create())
                {
                    Console.WriteLine("Введите полное имя папки или диска (с указанием пути)");
                    string path = Console.ReadLine();
                    CheckPath.СhekedPathToDirectory(ref path);

                    byte[] decripted;
                    try
                    {
                        Console.WriteLine("Введите полное имя ключа(с указанием пути)");
                        string pathToKey = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref pathToKey);
                        Console.WriteLine("Ключ  ");
                        foreach (var value in ReadWriteFile.ReadFile(pathToKey))
                        {
                            Console.Write(value);
                        }
                        Console.WriteLine();

                        Console.WriteLine("Введите полное имя вектора инициализации (с указанием пути)");
                        string pathToIV = Console.ReadLine();
                        CheckPath.СhekedPathToFile(ref pathToKey);
                        foreach (var value in ReadWriteFile.ReadFile(pathToIV))
                        {
                            Console.Write(value);
                        }

                        // Encrypt the string to an array of bytes.
                        foreach (var i in GettFiles.LookIn(path))
                        {
                            Console.WriteLine(i);
                            // Encrypt the string to an array of bytes.
                            if (ReadWriteFile.ReadFile(i).Length != 0)
                            {
                                decripted = CifherAes.DecryptBytes_Aes(ReadWriteFile.ReadFile(i),
                                                                       ReadWriteFile.ReadFile(pathToKey),
                                                                       ReadWriteFile.ReadFile(pathToIV));
                                ReadWriteFile.WriteFile(i, decripted);
                            }
                            else
                            {
                                Console.WriteLine("файл пустой,  " + i + " с ним нельзя работать ");
                            }
                        }
                        GettFiles.LookIn(path).Clear();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }
                }

                break;

            default:
                Console.WriteLine("Вы нажали неизвестную  команду");
                break;
            }
        }
Ejemplo n.º 29
0
        public void ReadTest()
        {
            ReadWriteFile read = new ReadWriteFile();

            testList = read.ReadFileToList("unsorted.txt");
        }