Using System;
Using System. Text;
Using System. IO;
Namespace: an encrypted file program.
{
Public class _ enter your encryption Password
{
Private string password;
Public string Password
{
Get {return password ;}
Set {password = value ;}
}
Public _ enter your encrypted password (string temp)
{
This. password = temp;
}
Public _ enter your encrypted password ()
{
Console. WriteLine ("enter your password :");
This. Password = Console. ReadLine (); // not completed .. I don't know. It's raining. I went to bed first.
}
}
Files encrypted by public class
{
_ Enter your encrypted password = null;
Public readonly int count; public readonly char [] password;
Public-encrypted file ()
{
}
Public-encrypted file (string temp)
{
If (File. Exists (@ temp ))
{
StreamReader str = new StreamReader (@ temp );
String mytemp = str. ReadToEnd ();
If (mytemp. Length> 0)
{
Password = new _ enter your encrypted password ();
Count = password. Password. ToString (). Length;
Password = new char [count];
For (int I = 0; I <count; I ++)
{
Password [I] = (char) Password. password [I];
Password [I] ^ = PASSWORD [I];
}
}
Else
{
Console. WriteLine ("file is empty ");
}
}
Else
{
Throw new FileNotFoundException ();
}
}
}
Public class MainRun
{
Static void Main ()
{
Encrypted file anew = new encrypted file (@ "c: \ 1.txt ");
}
}
}