VB如何实现RS232端口通信?
本人菜鸟 高手来帮我看看VB如何实现RS232端口通信? --------------------编程问答-------------------- SerialPort ,具体去看MSDN
--------------------编程问答-------------------- imports systme.io.ports
sub main()
Dim OutP As New IO.Ports.SerialPort
OutP.PortName = "Com1"
OutP.BaudRate = 9600
OutP.Write("Hello!")
'假定那边会回复“OK!"
Dim i As Long
For i = 1 To 100
System.Threading.Thread.Sleep(10)
If OutP.BytesToRead >= 3 Then Exit For
Next
If i > 100 Then
MsgBox("对方无应答")
Else
MsgBox(OutP.ReadLine)
End If
end sub
补充:.NET技术 , VB.NET