Reading from a cryptostream to the end of the stream

前端 未结 3 1312
难免孤独
难免孤独 2020-12-17 04:30

I\'m having some trouble with the code below. I have a file in a temporary location which is in need of encryption, this function encrypts that data which is then stored at

3条回答
  •  难免孤独
    2020-12-17 04:48

    Another way to read CryptoStream is to using CopyTo methord:

    ...
    
        using (var output = new MemoryStream())
        {
           cryptStream.CopyTo(output);
           return output.ToArray();
        }
    
    ...
    

提交回复
热议问题