using System;
using System.IO.Ports;
namespace sampleserialport
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
string[] ports = SerialPort.GetPortNames();
Console.WriteLine("The following serial ports were found:");
// Display each port name to the console.
foreach(string port in ports)
{
Console.WriteLine(port);
}
Console.ReadLine();
}
}
}
это код, который я использую, но получаю ошибку в строке
string[] ports = SerialPort.GetPortNames();
как
System.PlatformNotSupportedException: 'Перечисление имен последовательных портов не поддерживается на текущей платформе. '