使用TripleDESCryptoServiceProvider類別來對連線資串解密
暂无评分
StringDecrypt(StringstrToDecrypt)
{
//將要解密的字串編碼成Byte
Byte[]inputByteArray=Convert.FromBase64String(strToDecrypt);
using(MemoryStreamobjOutputStream=newMemoryStream())
{
//將字串解密
CryptoStreamobjCryptoStream=newCryptoStream(objOutputStream,
objTripleDES.CreateDecryptor(bytKey,bytIV),
CryptoStreamMode.Write);
objCryptoStream.Write(inputByteArray,0,inputByteArray.Length);