Imports System Imports System.Data Imports System.Configuration Imports System.Collections Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.IO.Ports Partial Class Main Inherits System.Web.UI.Page Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load Dim Serialport7 As New IO.Ports.SerialPort With Serialport7 .PortName = "COM7" .BaudRate = 9600 .Parity = Parity.None .DataBits = 8 .StopBits = StopBits.One End With Try Serialport7.Open() Catch ex As Exception MsgBox(ex.ToString) End Try Dim ReceivedData As String ReceivedData = Serialport7.ReadLine() If ReceivedData.Substring(0, 1) = "T" Then TextBox1.Text = ReceivedData.Remove(0, 1) ElseIf ReceivedData.Substring(0, 1) = "H" Then TextBox2.Text = ReceivedData.Remove(0, 1) End If TextBox3.Text = System.DateTime.Now Serialport7.Close() End Sub End Class
if
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)