Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 C# 中将输出发送到 LPT。我使用 SerialPort 类。我将端口名称设置为“LPT1”,但出现此错误。
给定的端口名称不以 COM/com 开头或不解析为有效的串行端口。参数名称:portName
该怎么办?
您不能使用 SerialPort 访问并行端口。这将需要 P/Invokeinpout32.dll才能访问。有关详细信息,请参阅本教程。
inpout32.dll