How it works...

In steps 1 to 5, we opened Visual Studio 2017, created an empty solution, and gave it a proper name. In steps 7 to 11, we added a .NET Standard 2.0 library to the solution. In steps 12 and 13, we changed the default name of the class generated from the template. In step 15, we added the System.IO namespace that contains the file encryption and decryption functionality.

In step 16, we added a class-wide private string variable to hold the filename to encrypt and decrypt. In step 17, we added the default constructor that populates the private variable to hold the filename. In step 18, we added a method to encrypt the file. We used the Encrypt() method of the file class found in the System.IO namespace. We did the same in step ...

Get .NET Standard 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.