徐州麦克技术服务有限公司济南市地区分站 - 提供专业的解决方案!

济南市

当前位置: 济南市 > 行业资讯 > 文章页

填充无效,无法被移除。

时间:2025-10-04 23:52来源:网络编辑:济南市 点击: 5 次
以下内容是CSDN社区关于解密时出现问题了--填充无效,无法被移除。相关内容,如果想了解更多关于C#社区其他内容,请访问CSDN社区。

public static bool AESDecrypttoSingle(string filePath, string strKey)//(解密文件路径,解密密码)
{
string dir = Directory.GetParent(filePath).ToString();
SymmetricAlgorithm aes = Rijndael.Create();

FileStream fs = File.OpenRead(filePath);

aes.Key = Encoding.UTF8.GetBytes(strKey);
aes.IV = _key1;
byte[] decryptBytes = new byte[(int)fs.Length];
fs.Read(decryptBytes, 0, 1);
fs.Close();
MemoryStream ms = new MemoryStream(decryptBytes);
CryptoStream cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Read);

cs.Read(decryptBytes, 0, decryptBytes.Length);//填充无效,无法被移除。
cs.FlushFinalBlock();
fs.Close();
fs = File.OpenWrite(dir + "\\Encryption.txt");
foreach (byte b in ms.ToArray())
{
fs.WriteByte(b);

}
fs.Close();
cs.Close();
ms.Close();
return true;


}


求高手帮忙看看,“填充无效,无法被移除。”这句话怎么回事啊?单步我看不懂


(提示:济南市麦克技术服务有限公司为您提供济南市专业的劳务派遣公司、济南市劳务外包公司、济南市最好的劳务派遣公司、济南市劳务服务外包公司、济南市物业管理服务、济南市保安服务、济南市人事代理、济南市人力资源外包服务公司、济南市区域人力资源服务商)
------分隔线----------------------------