C#でシリアル通信

C#でシリアル通信(ComPort)を使う場合、System.Io.Portsをusingしておくこと。


using System.IO.Ports;

namespace WpfApplication2
{
///


/// MainWindow.xaml の相互作用ロジック
///

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();

var window = Window.GetWindow(this);
var serialPort = new SerialPort();

}
}
}