コード例 #1
0
ファイル: Form1.cs プロジェクト: smarchenah/PGPEncryption
        /// <summary>
        /// ENCRYPT
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\Users\marchena.INCAS\Desktop\Sergio\Dokumenten\VoiceCleaner";
            openFileDialog1.Filter           = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                _FileNameToEncript = openFileDialog1.FileName;
                //var encryptedFile = encryptionService.EncryptFile("73047DAF", _FileNameToEncript, _FileNameToEncript + ".pgp");
                var encryptedFile = encryptionService.EncryptFile("7C041649", _FileNameToEncript, _FileNameToEncript + ".pgp");
                lblInfo.Text = "The File " + openFileDialog1.SafeFileName + " has been successfully encrypted.";
                txtInfo.Text = _FileNameToEncript + ".gpg";
            }
        }