Example #1
0
        } //Doesn't need to change

        private void OpenEncryptedFileByteByte(object sender, RoutedEventArgs e)
        {
            string file = CrudFile.SetFileLocation();

            byte[] data;
            try
            {
                data = GetBytes(CrudFile.CallOpenFileDialogS(file));
                if (data != null)
                {
                    dataContent.Text = BitConverter.ToString(data);
                }
                else if (fromBitConverterResult)
                {
                    dataContent.Text = BitConverter.ToString(CrudFile.CallOpenFileDialogB(file));
                }
                else
                {
                    dataContent.Text = Encoding.ASCII.GetString(CrudFile.CallOpenFileDialogB(file));
                }
                crypTypeStanMenuItem.IsChecked = true;
            }
            catch (ArgumentNullException)
            {
                return;
            }
            catch (FormatException)
            {
                MessageBox.Show("Incorrect input value!");
            }
        } //Exist, Correct!
Example #2
0
        } //Exist, Correct!

        private void OpenDecryptedFile(object sender, RoutedEventArgs e)
        {
            string file = CrudFile.SetFileLocation();

            try
            {
                dataContent.Text = CrudFile.CallOpenFileDialogS(file);
            }
            catch (ArgumentNullException)
            {
                return;
            }
        } //Exist
Example #3
0
        } //Exist, Correct!

        private void OpenEncryptedFileBase64Base64(object sender, RoutedEventArgs e)
        {
            string file = CrudFile.SetFileLocation();

            byte[] data;
            try
            {
                data             = Convert.FromBase64String(CrudFile.CallOpenFileDialogS(file));
                dataContent.Text = Convert.ToBase64String(data);
                crypTypeBase64MenuItem.IsChecked = true;
            }
            catch (ArgumentNullException)
            {
                return;
            }
            catch (FormatException)
            {
                MessageBox.Show("Incorrect input data!");
                return;
            }
        } //Exist, Correct!
Example #4
0
        } //Exist, Correct!

        private void OpenEncryptedFileByteBase64(object sender, RoutedEventArgs e)
        {
            string file = CrudFile.SetFileLocation();

            byte[] data;
            try
            {
                data = GetBytes(CrudFile.CallOpenFileDialogS(file));
                if (data != null)
                {
                    dataContent.Text = Convert.ToBase64String(data);
                }
                else
                {
                    dataContent.Text = Convert.ToBase64String(CrudFile.CallOpenFileDialogB(file));
                }
                crypTypeBase64MenuItem.IsChecked = true;
            }
            catch (ArgumentNullException)
            {
                return;
            }
        } //Exist, Correct!