I am working on a "Kill Switch" program in C# where if I do not verify in the software within a time limit it will encrypt all of my files using B64(I will make my own algorithm later on) but currently there is a error where the software does not encrypt all lines of code, it only encrypts the first line and then deletes the rest. Any ideas?
Code:
foreach (string fileName in Directory.GetFiles("D:/Desktop/encTest"))
{
string msg = "";
using (StreamReader sr = new StreamReader(fileName))
{
msg = Base64StringEncode(sr.ReadLine());
}
string docPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
using (StreamWriter outputFile = new StreamWriter(Path.Combine(docPath, fileName)))
{
outputFile.WriteLine(msg);
}
}
I also have a function for B64 encryption!