T
Tony Johansson
Hi!
Here is a simple program where a StreamWriter writes some strings to a
MemoryStream and
then is this MemoryStream writing it's contents to a file by using a
FileStream
Now is it possible that some data will not be written to the MyFile.txt if I
don't have a Flush
on the memstr like this memstr.Flush();?
MemoryStream memstr = new MemoryStream();
StreamWriter sw = new StreamWriter(memstr );
sw.WriteLine("Test1");
sw.WriteLine("Test2"):
sw.WriteLine("Test3"):
sw.Flush();
FileStream fs = File.Create("MyFile.txt");
memstr.WriteTo(fs);
....
//Tony
Here is a simple program where a StreamWriter writes some strings to a
MemoryStream and
then is this MemoryStream writing it's contents to a file by using a
FileStream
Now is it possible that some data will not be written to the MyFile.txt if I
don't have a Flush
on the memstr like this memstr.Flush();?
MemoryStream memstr = new MemoryStream();
StreamWriter sw = new StreamWriter(memstr );
sw.WriteLine("Test1");
sw.WriteLine("Test2"):
sw.WriteLine("Test3"):
sw.Flush();
FileStream fs = File.Create("MyFile.txt");
memstr.WriteTo(fs);
....
//Tony