Why FileStream can't read data from serial port?

  • Thread starter Thread starter cczzhh
  • Start date Start date
C

cczzhh

i write the code to access serial port follows:

FileStream fs=new FileStream
("COM1:",FileMode.Create);//its OK
fs.Write(...);//its OK
fs.Read(...);//throw IOException

who can help me,thanks very much.
 
cczzhh said:
FileStream fs=new FileStream
("COM1:",FileMode.Create);//its OK
fs.Write(...);//its OK
fs.Read(...);//throw IOException

Are you sure you can Read when the mode is FileMode.Create?

P.
 
Back
Top