[英]The type name 'SerialPort' could not be found in the namespace 'System.IO.Ports'
[英]SerialPort (.net) - not ports found
using System;
using System.IO.Ports;
public static void getPorts()
{
string[] ports = SerialPort.GetPortNames();
Console.WriteLine("The following serial ports were found:");
foreach (string port in ports)
{
Console.WriteLine(port);
}
Console.ReadLine();
}
我对这个简单的代码有问题。 我需要写出我的端口,因为我稍后会使用它们(我在我更大的应用程序中使用这个简单的功能)。 一切正常,直到我升级了我的 Windows。 你知道可能是什么问题吗? 我也安装了所有驱动程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.