![](/img/trans.png)
[英]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.