Printing on dot-matrix printer in .NET
-
Hi, In VB6 i use this sample of code to print directly to the printer. I mean EPSON compatibile dot-matrix printers Open “LPT1” For Output as #1 Or Open “\\Server\printer” For Output as #1 Print #1, “something i what to print” Print #1, “something else ...” .... Close #1 What I need is to open printer port (LPT1 or \\computer\printer ) like any other file on hard drive, as simple as posible. I don’t need to print any graphics, just draft (plain) text with a lot of ESCAPE sequences like Pica,Picacondesd, Elite ... When I use FileOpen(1, “LPT1”, OpenMode.Output) PrintLine(1, "This is a test.") in VB.NET I get an error Additional information: FileStream was asked to open a device that was not a file. FileStream's constructors that take a String will only work with devices that are really files. If you need support for devices like "com1:" or "lpt1:", then call CreateFile yourself then use the FileStream constructors that take an OS handle as an IntPtr. Let me know if you have any sugestions for my problem Thanks in advance p.s Sorry for my bad English Tancev