I was hoping someone could explain to me why this is happening :)
When I use the code below it gives me the error "The process cannot access the file 'C:\test.txt' because it is being used by another process."
I'm very new to C# so I'm not sure what is going on, thanks in advance!
String fileNameBefore = @"C:\\test.txt";
public void output(String hex)
{
using (StreamWriter writer = new StreamWriter(fileNameBefore, true))
{
writer.Write(hex);
writer.Close();
}
}
Close the text file before you write to it. (Not in code...physically close the text file)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With