Michael

Michael

  • NA
  • 40
  • 0

StreamWriter Wont Write

Jan 13 2007 8:55 PM
i've got a simple save rountine for a program yet it doesn't work any ideas why not?

1st version
private void SaveConfig(){
StreamWriter write = File.CreateText(filename);
write.WriteLine(dir);
write.WriteLine(textBox1.Text);
write.Flush();
write.Close();
}

file output
C:\

2nd version
private void SaveConfig(){
StreamWriter write = File.CreateText(filename);
write.WriteLine(dir);
string tmp = textBox1.Text;
Console.WriteLine(dir);
Console.WriteLine(tmp);
write.WriteLine(tmp);
write.WriteLine(textBox1.Text);
write.Flush();
write.Close();
}

console output
C:\
-w 1280 -h 768

file output
C:\

Answers (1)