为什么Microsoft AES对using语句后的解密数据进行采样return

Why does the Microsoft AES sample return the decrypted data after the using statement

查看该示例:https://msdn.microsoft.com/en-us/library/system.security.cryptography.aesmanaged.aspx

微软returnsusing语句后的解密数据

是否有特殊原因,因为该样本正在使用流式处理 类?

或者这只是一个快速组合的样本?

这只是一个快速组合的示例,如果他们这样做了 return srDecrypt.ReadToEnd(); 就会有完全相同的行为。

他们可能将它分开,以便更清楚地表明 ReadToEnd() 正在返回一个可以存在于 using 范围之外的字符串对象。