Esempio n. 1
0
        private void decryptFileDrop_Click(object sender, EventArgs e)
        {
            string fileToDecrypt = "";

            if (openFileToDecrypt.ShowDialog() == DialogResult.OK)
            {
                if (!FileAES_Utilities.isFileDecryptable(openFileToDecrypt.FileName))
                {
                    MessageBox.Show("Please select a valid filetype.", "Invalid Filetype");
                }
                else
                {
                    fileToDecrypt     = openFileToDecrypt.FileName;
                    Program.doDecrypt = true;
                    using (FileAES_Decrypt decrypt = new FileAES_Decrypt(fileToDecrypt.Replace(@"\\", @"\")))
                    {
                        decrypt.StartPosition = FormStartPosition.CenterParent;
                        decrypt.ShowDialog();
                        decrypt.Focus();
                    }
                }
            }
        }
Esempio n. 2
0
        private void decryptFileDrop_DragDrop(object sender, DragEventArgs e)
        {
            string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);

            if (FileList.Length > 1)
            {
                MessageBox.Show("You may only decrypt a single file at a time.", "Multiple Files Unsupported");
            }
            else if (!FileAES_Utilities.isFileDecryptable(FileList[0]))
            {
                MessageBox.Show("Please select a valid filetype.", "Invalid Filetype");
            }
            else
            {
                Program.doDecrypt = true;
                using (FileAES_Decrypt decrypt = new FileAES_Decrypt(FileList[0].Replace(@"\\", @"\")))
                {
                    decrypt.StartPosition = FormStartPosition.CenterParent;
                    decrypt.ShowDialog();
                    decrypt.Focus();
                }
            }
        }