FileStream 개체를 사용하여 네트워크상의 다른 파일에서 데이터를 읽으려고합니다. 그래서 필요한 파일의 일부를 읽으려면 Tasks (System.Threading.Tasks)를 만들었습니다.System.Threading.Tasks 및 FileStream
매우 놀랍습니다. 이러한 작업에서 오류가 발생합니다 :
int_ReadBytes = stm_BaseStream.Read (byt_buffer, 0, (int) (int_RecordLength * uint_BufferThis));
if (int_ReadBytes != (int_RecordLength * uint_BufferThis))
{
throw new Exception ("Could not read record");
// throws an error here.
}
누구든지 FileStream 개체로 작업을 사용하거나이 문제가 발생하는 이유를 알고 있습니까? 감사합니다. .
stm_BaseStream을 Task에 선언했는지, 아니면 그 안에서 선언 했습니까? –
아마 파일의 끝에 있습니까? – 321X
오류 메시지가 무엇입니까? –