简体   繁体   English

C#LPT名称问题

[英]C# LPT Name problem

How can I send output to LPT in C#. 如何在C#中将输出发送到LPT。 I use SerialPort class. 我使用SerialPort类。 I set port name to "LPT1" and I'm getting this error. 我将端口名称设置为“ LPT1”,并且出现此错误。

The given port name does not start with COM/com or does not resolve to a valid serial port. 给定的端口名不能以COM / com开头或不能解析为有效的串行端口。 Parameter name: portName 参数名称:portName

What to do? 该怎么办?

You can't use SerialPort to access a Parallel Port. 您不能使用SerialPort访问并行端口。 This will require P/Invoke to inpout32.dll to access. 这将要求P / Invoke访问inpout32.dll For details, see this tutorial . 有关详细信息,请参见本教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM