How to access device like PRN, LPT1, COM1

  • Thread starter Thread starter IAmWind
  • Start date Start date
I

IAmWind

i need to access these devices, but i cann't get
information from .net framework document.
i use FileStream("PRN", FileMode.Create,
FileAccess.Write);. when it runs, system reported
exception.
 
Hi,

What is it that you really want to do? The procedures required will vary.
As Chris says, you can P/Invoke the underlying APIs. This works for serial
ports, as does using various ActiveX add-ons, or other serial objects.
However, depending on what you want to do with the printer port you may not
need (or be able to) use Windows APIs.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
i cann't understand your words completely.
but i will study for it.
i wrote a DLL to wrap that operation, then P/Invoke in C#.
thanks again.
 
Back
Top