private void utxEncryptBtn_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "UTX Files |*.utx"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UTXParser parser = new UTXParser(); string encryptedFile = parser.Encrypt(ofd.FileName); if (encryptedFile != null) { if (MessageBox.Show( "File Encrypted Successfully , do you wanna me save it for you ?", "Encryption Success", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "Save Encrypted UTX File : "; sfd.FileName = Path.GetFileName(encryptedFile); sfd.Filter = "UTX Files |*.utx"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { File.Copy(encryptedFile, sfd.FileName); } } } } }
private void button4_Click(object sender, EventArgs e) { if (CurrentPath == null || CurrentPath == "" || !File.Exists(CurrentPath)) { MessageBox.Show("Please Load a Valid UTX File"); return; } UTXParser parser = new UTXParser(); string decryptedFile = parser.Decrypt(CurrentPath); if (decryptedFile != null) { if (MessageBox.Show( "File Encrypted Successfully , do you wanna me save it for you ?", "Encryption Success", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "Save Encrypted UTX File : "; sfd.FileName = Path.GetFileName(decryptedFile); sfd.Filter = "UTX Files |*.utx"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { File.Copy(decryptedFile, sfd.FileName); } } } else { MessageBox.Show("Error with File Parsing"); } }
private void utxDecryptBtn_Click(object sender, EventArgs e) { string btnText = utxDecryptBtn.Text; utxDecryptBtn.Text = "Processiong"; utxDecryptBtn.Enabled = false; OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "UTX Files |*.utx"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UTXParser parser = new UTXParser(); string decryptedFile = parser.Decrypt(ofd.FileName); if (decryptedFile != null) { if (MessageBox.Show( "File Decrypted Successfully , do you wanna me save it for you ?", "Decryption Success", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "Save Encrypted UTX File : "; sfd.FileName = Path.GetFileName(decryptedFile); sfd.Filter = "UTX Files |*.utx"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { File.Copy(decryptedFile, sfd.FileName); } } } } utxDecryptBtn.Enabled = true; utxDecryptBtn.Text = btnText; }