日期:2014-05-18  浏览次数:20337 次

关于StreamReader的问题
我用StreamReader读取文本文件,发现每次readline取到的字符串都会把这一行最后一个非空字符以后的空格都cut掉了,但我是需要这些空格的,有什么办法解决?

------解决方案--------------------
看看你的代码

------解决方案--------------------
我是用如下的代码测试的,没有发现问题:
string path = @ "d:\temp\test.txt ";
StreamReader sr = new StreamReader(path);
String line;
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}

sr.Close();

------解决方案--------------------
不会啊 mark