首页上一页 1 下一页尾页 3 条记录 1/1页
我想同时加密解密textBox1 textBox2 textBox3 该怎么写呀?
发表在C#图书答疑
2010-07-01
是否精华
是
否
版块置顶:
是
否
try
{
DESCryptoServiceProvider descsp = new DESCryptoServiceProvider();
byte[] key = Encoding.Unicode.GetBytes(encryptKey);
byte[] data = Encoding.Unicode.GetBytes(textBox1.Text.Trim());
MemoryStream MStream = new MemoryStream();
CryptoStream CStream = new CryptoStream(MStream, descsp.CreateEncryptor(key, key), CryptoStreamMode.Write);
CStream.Write(data, 0, data.Length);
CStream.FlushFinalBlock();
textBox1.Text = Convert.ToBase64String(MStream.ToArray());//[font color=#FF0000]下面我想再加密解密textBox2 textBox3 该怎么写呀?
[/font]
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
{
DESCryptoServiceProvider descsp = new DESCryptoServiceProvider();
byte[] key = Encoding.Unicode.GetBytes(encryptKey);
byte[] data = Encoding.Unicode.GetBytes(textBox1.Text.Trim());
MemoryStream MStream = new MemoryStream();
CryptoStream CStream = new CryptoStream(MStream, descsp.CreateEncryptor(key, key), CryptoStreamMode.Write);
CStream.Write(data, 0, data.Length);
CStream.FlushFinalBlock();
textBox1.Text = Convert.ToBase64String(MStream.ToArray());//[font color=#FF0000]下面我想再加密解密textBox2 textBox3 该怎么写呀?
[/font]
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}