Wheen
Bytesexual
Retired
I'm having trouble reading from one file, encrypting the text, and then writing it again. Below is a stripped down version of the algorithm I'm using. It works perfectly, but it doesn't clear the memory after it is done. For example, if it takes 100,000kb to do it the first time, if I run it again without restarting the program, it goes up to 200,000kb, and once the method is finished, it doesn't return back to normal. Here's the algorithm:
Any helps is appreciated.
Code:
StreamReader file = new StreamReader(origPath);
StreamWriter newFile = new StreamWriter(newPath);
try
{
string line;
while ((line = file.ReadLine()) != null)
{
newFile.WriteLine(line);
}
newFile.Close();
file.Close();
}
Any helps is appreciated.