Hi,
I use a simple static funtion to output errors, trace messages...
However when i call the same function more than one I get an error that
the text file is used by another application..
public static void echo(string logMessage){
StreamWriter w = File.AppendText("log.txt");
DateTime d = DateTime.Now;
w.WriteLine(d.ToString()+logMessage);
w.Flush();
w.Close();
w = null;
}
//call the fucntion Form1.echo ("error message");
What am I doing wrong? Is there a better way...