FileStream throwing exception

  • Thread starter Thread starter George
  • Start date Start date
G

George

Hi.

I'm doing a class for accessing the Serial port using a file stream.
I open the COM using CreateFile(win32API) and then create the file stream.
However when writting several times I get a System.IO.IOException with "An
attempt was made to move the file pointer before
the beginning of the file"

Any help. How could I avoid it?
 
I have already read it, but it seems to be for asynchronous comunication
and mine is sychronous. I don't know how i could get that library to
work.

BTW I have managed to solve my problem. Now I have openned 2 Filestream,
one from reading and the other for writting. This way it works.

Hi George,


I think that the best way of using the serial port is using an
existen
library, take a look at this article from MSDN magazine, you could
also google in this group for another solution, I know this has been
discussed before.

http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/

Cheers,



--
Saludos a todos
#
# Contra el canon de los CD's
# que ahora no haya protecciones ni multas
#
 
Back
Top