资 源 简 介
On Error GoTo errStr MSComm1.CommPort = 1 MSComm1.Settings = "9600,e,8,1" MSComm1.InputMode = comInputModeBinary MSComm1.Handshaking = comNone MSComm1.OutBufferSize = 1024 MSComm1.InBufferSize = 512 MSComm1.InputLen = 0 MSComm1.SThreshold = 1 MSComm1.RThreshold = 1 MSComm1.PortOpen = True Exit SuberrStr: If Err.Number = 8002 Then MsgBox "串口不存在", vbOKOnly Or vbInformation ElseIf Err.Number = 8005 Then MsgBox "串口已被占用", vbOKOnly Or vbInformation End If