MemoryStream读写
Stream s = new MemoryStream();
StreamWriter w = new StreamWriter(s);
w.WriteLine("!");
w.Flush();
//w.Close();
StreamReader r = new StreamReader(s);
Console.WriteLine(s.Length);
s.Position = 0;
Console.WriteLine(r.ReadToEnd());
-------------------------------------------------
!!!作者:木由水 http://www.cnblogs.com/muyoushui