Send print commands directly to LPT parallel port using C#.net [duplicate]
问题 This question already has answers here : Printing in (Parallel Port) Dot Matrix over C# (4 answers) Closed 2 years ago . As in DOS we can do: ECHO MESSAGE>LPT1 How can we achieve same thing in C# .NET? Sending information to COM1 seems to be easy using C# .NET. What about LPT1 ports? I want to send Escape commands to the thermal printer. 回答1: In C# 4.0 and later its possible, first you need to connect to that port using the CreateFile method then open a filestream to that port to finally