Foxtable(狐表)用户栏目专家坐堂 → 从字符串“Parity.Odd”到类型“Integer”的转换无效。


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

主题:从字符串“Parity.Odd”到类型“Integer”的转换无效。

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


加好友 发短信
等级:童狐 帖子:266 积分:2309 威望:0 精华:0 注册:2016/6/3 8:28:00
从字符串“Parity.Odd”到类型“Integer”的转换无效。  发帖心情 Post By:2021/8/4 22:16:00 [只看该作者]

Dim cob1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")'串口
Dim cob2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")'波特率
Dim cob3 As WinForm.ComboBox = e.Form.Controls("ComboBox3")'数据位
Dim cob4 As WinForm.ComboBox = e.Form.Controls("ComboBox4")'停止位
Dim cob5 As WinForm.ComboBox = e.Form.Controls("ComboBox5")'效验位
Dim cob6 As WinForm.ComboBox = e.Form.Controls("ComboBox6") '地址
Dim dr As DataRow = DataTables("INT").DataRows(0)

Ports.Add(cob1.Text)
If Ports(cob1.Text).IsOpen=False Then   
    With Ports(cob1.Text)
        .Close()
        .Encoding=Encoding.ASCII
        .BaudRate = cob2.Text
        .DataBits = cob3.Text
        .Parity = "Parity." & cob5.Text       '奇效验   值是 odd
        .StopBits = "StopBits." & cob4.Text  '停止位  1 值是 one
        .Handshake = Handshake.None
        '.ReadBufferSize() = 8192
        '.WriteBufferSize() = 4096
        .Open
    End With
end if



上述两个红字要怎么写?

 回到顶部