filestream을 통해 파일을 불러와 richbox에 넣고있습니다.
byte[] read = new byte[1024];
fileStream.Read(read, 0, Convert.ToInt32(read.Length));
readStartPosition = fileStream.Seek(read.Length, SeekOrigin.Begin);
richbox에 넣으면 처음부터 1024까지 문자열이 보여집니다.
문제는 여기서인데... 다시 같은 파일을 불러오면 1024 다음 문자부터 문자1024개가 richbox에 출력이 되야하는데 안됩니다..
다시 같은 파일을 불러오면, 처음 부터 1024까지 문자열이 보여집니다.
if(textBox1.TextLength != 0)
{
readStartPosition = fileStream.Seek(read.Length+1, SeekOrigin.Current);
byte[] aaa = new byte[fileStream.Position];
fileStream.Read(aaa, 0, Convert.ToInt32(readStartPosition));
}
richTextBox1.AppendText를 이용해 출력을 합니다.
디버깅해보니까 aaa = 2048 , read.Length = 1024, readStartPoition = 2048 입니다..
왜 그런지 모르겠습니다..
filestream.seek는 스트림의 현재 위치를 제공된 값으로 설정합니다. 라고 나와있는데.. 왜 1024다음 부터 안나오는지 머가 문제인지 쫌 알려주세요 ㅠㅠ
[최초 등록일: ]
[최종 수정일: 10/27/2014]