串口监视器,DataReceived参数“Length”必须大于或等于 0。System.ArgumentException: 参数“Length”必须大于或等于 0。
在 Microsoft.VisualBasic.Strings.Left(String str, Int32 Length)
在 UserCode.DataReceived(DataReceivedEventArgs e)
不知道问题出在哪儿?谢谢!
Dim s As String
s = e.Port.ReadExisting()
's = "LBL11A1512109+UBS"
If len(s) < 3 Then Return
' * check COM Input Type : LBL = Scanner ID for Label Printing
If left(s,3) = "LBL" Then
s = left( s, If(len(s)<25,22, s.IndexOf("LBL",17)) )
.....
End If
[此贴子已经被作者于2021/7/14 10:57:34编辑过]