FileStream fsCrypt = new FileStream(cryptFile, FileMode.Create)) using (CryptoStreamcs = new CryptoStream(fsCrypt, AES.CreateEncryptor(), CryptoStreamMode.Write))
{
我知道当CryptoStream抛出一个CryptoGraphicException时,它意味着出了问题,在本例中是用错误的密码解密的。我会给出这样的消息:“填充是无效的,无法删除”。/Files/" + fileNameAndExtension, FileMode.Create)) using (CryptoStreamcryptoStream = new CryptoStream(fileStream, aesManaged.Cr