SerialPort Class Represents a serial port resource.
Imports System
Imports System.IO.Ports
Imports System.Threading
Public Class PortChat
Shared _serialPort As SerialPort
Public Shared Sub Main()
Dim message As String
Dim sComparer As StringComparer = StringComparer.OrdinalIgnoreCase
_serialPort = New SerialPort()
_serialPort.ReadTimeout = 500
_serialPort.WriteTimeout = 500
_serialPort.Open()
_serialPort.WriteLine("message")
message = _serialPort.ReadLine()
Console.WriteLine(message)
End Sub
End Class
Related examples in the same category