C# File Decrypt

Description

File Decrypt Decrypts a file that was encrypted by the current account using the Encrypt method.

Syntax

File.Decrypt has the following syntax.


public static void Decrypt(
  string path
)

Parameters

File.Decrypt has the following parameters.

  • path - A path that describes a file to decrypt.

Returns

File.Decrypt method returns

Example

The following code example uses the Encrypt method and the Decrypt method to encrypt and then decrypt a file.


using System;/*  ww w .  j av  a 2 s . com*/
using System.IO;
using System.Security.AccessControl;

class FileExample
{
        public static void Main()
        {
            string FileName = "test.xml";
            File.Encrypt(FileName);
            File.Decrypt(FileName);
        }
}




















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter