2009/04/02

c# 建立空的StreamReader

public static StreamReader GetEmptyStreamReader()
{
MemoryStream ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms);
sw.Write("");
sw.Flush();
StreamReader sr = new StreamReader(ms);
return sr;
}

沒有留言: