# 利用 Comm 收发串列资料 !!

Posted by ERIC on January 23, 1998 at 10:59:53:

请问如何利用 mscomm来收发串列资料呢??

我写了一个测试程试为何总收到 " ? " or 中文乱码呢 ??

以下是程式内容 ......

Private Sub Command1_Click()
aa:
MSComm1.PortOpen = True
Do
DoEvents
Loop Until MSComm1.InBufferCount >= 2
a = MSComm1.Input
Print a
MSComm1.PortOpen = False
GoTo aa
End Sub

Private Sub Form_Load()
MSComm1.CommPort = 3
MSComm1.Settings = "2400,N,8,1"
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeBinary

End Sub

Follow Ups:

- 使用 byte array 小吴 06:36:12 2/01/98 (0)