在有以下代码中,如何将流更改为接收字符串变量?
// open dictionary file
FileStream fs = new FileStream(dictionaryPath, FileMode.Open, FileAccess.Read, FileShare.Read);
StreamReader sr = new StreamReader(fs, Encoding.UTF8);
// read line by line
while (sr.Peek() >= 0)
{
string tempLine = sr.ReadLine().Trim();
if (tempLine.Length > 0)
{
// check for section flag
switch (tempLine)
{
case "[Copyright]" :
case "[Try]" :
case "[Replace]" :
case "[Prefix]" :
...
...
...