--
==============================
Comunidade de desenvolvedores Dot Net no Brasil
".Net Br" no Google Groups: http://groups.google.com.br/group/dotnet_br/
E-mail do Grupo: dotn...@googlegroups.com
"Your Potential. Our Passion."
==============================
Comunidade de desenvolvedores PHP
"LISTA PHP" no Google Groups: http://groups.google.com.br/group/listaphp
E-mail do Grupo: list...@googlegroups.com
Tenta aí amigão...
Na hora de escrever, use o tipo BYTE, o streamwriter tem um método p/ isso!
StreamReader fPipeIn = new StreamReader(WinAPIWrapper.GetFileStreamFromGuid(DeviceGuid, @"\PIPE00"));
StreamWriter fPipeOut = new StreamWriter(WinAPIWrapper.GetFileStreamFromGuid(DeviceGuid, @"\PIPE01"));
// At this point I can do fPipeIn.ReadLine() and it works very well
// Create the data to send to the device
int command = 11;
byte[] data = new byte[1]{(byte)command};
// This method does NOT work. Why? fPipeOut is set to AutoFlush by the way
fPipeOut.Write(data);
// This method, accessing the Windows API WriteFile function directly with the FileStream.SafeFileHandle, works just fine
WinAPIWrapper.WriteToStream((FileStream)fPipeOut.BaseStream, data);