The process cannot access the file 'C:\C# Files\Test\LevelRetest1.txt' because it is being used by another process.
I have added the "Using System.IO" in the declarations,set the path and created a stream reader object
// This sets the path in which the text file will be created.
private string path = @"C:\C# Files\Test\" + "LevelRetest1.txt";
// Creates a StreamWriter and a StreamReader object
private System.IO.StreamWriter sw;
i thought I could just then write a line in the OnBarUpdate() by adding the following
sw.WriteLine ("Text");
But I keep getting that error so obviously I am doing it wrong. Any thoughts

Comment