试了好几个文件,内容是英文的,大小不超过5k,但是每次都在大概31,32行时一下冒出两行来,然后就彻底乱了
代码如下
FileStream abcFile = new FileStream("abc.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(abcFile);
String[] str1 = new String[96];
String[] str2 = new String[96];
str1[0] = sr.ReadLine();
for (int i = 0; str1[0] != null; i++)
{
str2[i] = sr.ReadLine();
str1[i+1] = sr.ReadLine();
}
写入的时候要清缓冲,读取有缓冲吗,我找了也没找到