using System.Security.Cryptography; // create a new Rijndael object Rijndael rijndael = Rijndael.Create(); // use the Rijndael object to encrypt some data // dispose of the Rijndael object when finished rijndael.Dispose();
using (Rijndael rijndael = Rijndael.Create()) { // use the Rijndael object to encrypt some data } // Rijndael object is automatically disposed at end of using blockBoth examples show how to use the Dispose method to release resources used by the Rijndael object. The Rijndael class is part of the .NET Framework and does not require any additional package libraries.