Hi,
I find your post in devx.com and I have one question for VB.NET platform.(Sorry for my bad English.)
In VB6 i use this sample of code to print directly to the printer. I mean EPSON compatibile dot-matrix printers
This mode of caracter printing more quick than Graphic Mode(Windows)
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.
In VB6 i used to di this whit
open ?LPT1? for output as #1 – as I said
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