//
How to use SaveFileDialog to save text files?
Stream myStream ;
SaveFileDialog saveFileDialog1
=
new
SaveFileDialog();
saveFileDialog1.Filter
=
"
txt files (*.txt)|*.txt|All files (*.*)|*.*
"
;
saveFileDialog1.FilterIndex
=
2
;
saveFileDialog1.RestoreDirectory
=
true
;
if
(saveFileDialog1.ShowDialog()
==
DialogResult.OK)
{
if
((myStream
=
saveFileDialog1.OpenFile())
!=
null
)
{
StreamWriter wText
=
new
StreamWriter(myStream);
wText.Write(
"
your text
"
);
myStream.Close();
}
}
from:
http://zamov.online.fr/EXHTML/CSharp/CSharp_302155.html