Well, reading one *byte* at a time is a little dangerous anyway (unless
you know the data is ASCII or another single-byte encoding [UTF8 is not
single-byte for most of the possible chars]).
I'm not entirely sure whether your input is meant to be in plain text,
or SendKeys format; if plain text, and you want to send the literal
"{LEFT 10}", then you need to escape the reserved chars - i.e. any of:
+, ^, %, ~, {, }, [, ], (, )
The rules for this are here:
http://msdn.microsoft.com/en-us/libr...83(VS.85).aspx
If the file is meant to be already in SendKeys format, why do you need
to parse \r etc?
Anyway, you could use StreamReader to read it a line at a time, and send
lines rather than individual characters - although if the file is in
SendKeys format, I think I would not send anything for CR/LF, and just
use it to break up the text - i.e. I might have:
some~
text~
that
might
be~
on~
different
lines
In addition to solving the issue with sending "{", "E", "N", "T", "E",
"}", this would involve fewer IPC calls, so should be quicker.
Marc