|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace EnCryptDecrypt
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void btnEncrypt_Click(object sender, EventArgs e)
{
if (txtClearText.Text == "")
{
error.SetError(txtClearText, "Enter the text you want to encrypt");
}
else
{
error.Clear();
string clearText = txtClearText.Text.Trim();
string cipherText = CryptorEngine.Encrypt(clearText, true);
txtDecryptedText.Visible = false;
label3.Visible = false;
txtCipherText.Text = cipherText;
btnDecrypt.Enabled = true;
}
}
private void btnDecrypt_Click(object sender, EventArgs e)
{
string cipherText = txtCipherText.Text.Trim();
string decryptedText = CryptorEngine.Decrypt(cipherText, true);
txtDecryptedText.Text = decryptedText;
txtDecryptedText.Visible = true;
label3.Visible = true;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am Syed Moshiur Murshed from Bangladesh. I studied BSC in Computer Science at American International University Bangladesh(www.aiub.edu). And then MSC in Software Technology at Stuttgart University of Applied Science, Germany(www.hft-stuttgart.de). Currently I am employed as a Software Engineer at Pöyry Infra GmbH in Salzburg, Austria since 04-2011.
I have been learning C# for quite some time and Enjoying it.