- FileStream fs = new FileStream("d:\\temp.txt",FileMode.Open);
- StreamReader reader = new StreamReader(fs,Encoding.Default);
- char[] buffer = new char[1024];
- int length = reader.Read(buffer, 0, buffer.Length);
- char[] data = new char[length];
- Buffer.BlockCopy(buffer, 0, data, 0, length);
复制代码 这里data的实际长度就不是length,什么问题 |