In this article csharpcanban.com will guide you How to Encrypt a File in C#, with examples and Demo code, you can download for use.
The Encrypt method encrypts a file so that only the account used to encrypt the file can decrypt
it.
string fileName = @"C:FileToEncrypt.txt"; FileInfo filetodecrypt = new FileInfo(fileName); filetodecrypt .Encrypt(); filetodecrypt .Decrypt();