i can't call this encrypt/decrypt...
Quote:
if (args == null || args.Length == 0)
{
Console.WriteLine("Please insert the file.");
Console.ReadKey();
return;
}
Console.WriteLine("Please select the option:");
Console.WriteLine("1.Encrypt");
Console.WriteLine("2.Decrypt");
byte[] data = File.ReadAllBytes(args[0]);
int option = 0;
if (int.TryParse(Console.ReadLine(), out option))
{
switch (option)
{
case 1:
{
for (int x = 0; x < data.Length; x++)
data[x] = (byte)(data[x] - 250);
break;
}
case 2:
{
for (int x = 0; x < data.Length; x++)
data[x] = (byte)(data[x] + 250);
break;
}
}
File.WriteAllBytes(args[0], data);
}
Console.WriteLine("Done.");
Console.ReadKey();
|