Parallel port interfacing with C#

Parallel port interfacing with C#

Post by Shahram Ah » Thu, 10 Jul 2003 17:51:43

I'm working on a project called controlling devices
over internet. The hardware intefacing part is to be
done through parallel port. The whole project have
been done using C# of .Net platform. My problem is
that I don't know what's the class that I can use to
communicate with parallel port and send a byte
corresponding to command I want to give out to device
connected to it. I don't want to use old system dll
files that might make my code unamanged and out of
.Net framework. I want to know the way I can have it
done in c#.

I'll be so thankful if you help me.
Thanks in advance,

Parallel port interfacing with C#

Post by Thomas Sch » Fri, 11 Jul 2003 06:30:54

.NET 1.0/1.1 has no support for legacy ports (COM/LPT)
You have to use PInvoke or Interop...

If the attached device follows printer hand-shaking protocols:
HOW TO: Send Raw Data to a Printer by Using Visual C# .NET :

If you want to control the port pins:
You have to install some kind of hardware drivers!
(Warning: will impact system security/reliability)

[NOTE: this is a restriction of the OS, not of .NET]

commercial, specific for printer ports, e.g.:
for .NET : generic IO


For more information about ports, check this sites:

for Interop, please use newsgroup:

Thomas Scheidegger - MVP .NET - 'NETMaster' ://