My.Computer.Ports
to send strings to the computer's serial ports in Visual Basic.My.Computer.Ports.OpenSerialPort
method to obtain a reference to the port. For more information, see OpenSerialPort.Using
block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block or within a Try...Catch...Finally
block.COM1
.COM1
; for more flexibility, the code should allow the user to select the desired serial port from a list of available ports. For more information, see How to: Show Available Serial Ports.Using
block to make sure that the application closes the port even if it throws an exception. For more information, see Using Statement.