Foxtable(狐表)用户栏目专家坐堂 → 串口监视器,DataReceived参数“Length”必须大于或等于 0


  共有2696人关注过本帖平板打印复制链接

主题:串口监视器,DataReceived参数“Length”必须大于或等于 0

帅哥哟,离线,有人找我吗?
tommyfung
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:183 积分:2020 威望:0 精华:0 注册:2013/2/28 18:11:00
串口监视器,DataReceived参数“Length”必须大于或等于 0  发帖心情 Post By:2021/7/14 10:51:00 [只看该作者]

串口监视器,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编辑过]

 回到顶部