Does anyone know how to print on POS printer (on com port) from C# (other
than using dos command type x.txt>com1)?
I have attempted with this but nothing happens
IntPtr ptr= CreateFile("COM1",
FileAccess.ReadWrite,
FileShare.ReadWrite,
0,
FileMode.Create,
0,
IntPtr.Zero );
FileStream fs = new FileStream(ptr,FileAccess.ReadWrite);
UnicodeEncoding UE = new UnicodeEncoding();
byte[] test = UE.GetBytes("abcde");
fs.Write(test,0,4);