469,946 Members | 1,851 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

print to pos printer

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);
Nov 16 '05 #1
0 1687

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by KohlerTommy | last post: by
1 post views Thread by Michael Beck | last post: by
12 posts views Thread by Peter Lin | last post: by
13 posts views Thread by Daniel Crespo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.