标题:这段代码错在那里啦?
只看楼主
dreamhouse
Rank: 1
等 级:新手上路
帖 子:107
专家分:7
注 册:2011-12-16
结帖率:59.46%
已结贴  问题点数:10 回复次数:1 
这段代码错在那里啦?
public void JIEMI(string strDESKey,string strCipher,string strDESIV)
        {
            byte[] bytesDESKey = ASCIIEncoding.ASCII.GetBytes(strDESKey);//密匙
            byte[] bytesSDESIV = ASCIIEncoding.ASCII.GetBytes(strDESIV);//向量
            byte[] bytesCipher = ASCIIEncoding.Unicode.GetBytes(strCipher);//密文
            DESCryptoServicePrvoider desDecrypt = new DESCryptoServicePrvoider();
            MemoryStream msDecrypt = new MemoryStream(bytesCipher);
            CryptoStream csDecrypt = new CryptoStream(msDecrypt, desDecrypt.CreateDecryptor(bytesDESKey, bytesDESIV), CryptoStreamMode.Read);
            StreamReader srDecrypt = new StreamReader(csDecrypt);
            string strPlainText = srDecrypt.ReadLine();
            srDecrypt.close();
            csDecrypt.Close();
            msDecrypt.Close();
            return strPlainText;
}
搜索更多相关主题的帖子: public 
2013-12-12 15:45
qw1161748579
Rank: 4
来 自:南充
等 级:业余侠客
威 望:1
帖 子:48
专家分:252
注 册:2013-9-23
得分:10 
string strPlainText = srDecrypt.ReadLine();
srDecrypt被引用不能Close
2013-12-16 10:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-425111-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.156069 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved