I am getting a "Process cannot access file being used by another process" when trying to save data to a text file. below is the streamwriter code.
Not sure why ..I call sw.Close();
I thought when calling the using statement you don't need to flush or close the file...the using is supposed to do this ?
InkedGFX
using (StreamWriter sw = new StreamWriter(Application.StartupPath + "[URL="file://\\SugarData.txt"]\\SugarData.txt[/URL]", true)) { sw.WriteLine(dateTimePicker1.Value + "," + txtBreakFast.Text + "," + txtLunch.Text + "," + txtDinner.Text + "," + txtBedTime.Text + "," + GlobalClass.Note); sw.Close(); }
Not sure why ..I call sw.Close();
I thought when calling the using statement you don't need to flush or close the file...the using is supposed to do this ?
InkedGFX