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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top