The File class provides the Encrypt and the Decrypt methods to restrict other users to open and read a file. Encrypt a File in C# The Encrypt method encrypts a file so that only the account used to encrypt the file can decrypt it. string fileName = @"c:\temp\Mahesh.txt"; File.Encrypt(fileName); Decrypt a File in C# The Decrypt method decrypts an encrypted file. Only account that has encrypted a file can decrypt a file. string fileName = @"c:\temp\Mahesh.txt"; File.Decrypt(fileName);
The File class provides the Encrypt and the Decrypt methods to restrict other users to open and read a file.
Encrypt a File in C#
The Encrypt method encrypts a file so that only the account used to encrypt the file can decrypt it.
string fileName = @"c:\temp\Mahesh.txt"; File.Encrypt(fileName);
Decrypt a File in C#
The Decrypt method decrypts an encrypted file. Only account that has encrypted a file can decrypt a file.
string fileName = @"c:\temp\Mahesh.txt"; File.Decrypt(fileName);
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: