以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]串口 的写法。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=88900)

--  作者:machle
--  发布时间:2016/8/11 11:36:00
--  [求助]串口 的写法。
给定关键字不在字典中。 什么原因?谢谢!


Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")

For Each sp As String In Ports.PortNames
    
    If Ports(""""& sp &"""").IsOpen Then
        
        cmb1.items.add(sp)
        
    End If
\'
messagebox.show(""""& sp &"""")   
    
Next



--  作者:大红袍
--  发布时间:2016/8/11 11:51:00
--  
Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")

For Each sp As String In Ports.PortNames
    
    If Ports(sp).IsOpen Then
        cmb1.items.add(sp)
    End If
  
Next

--  作者:machle
--  发布时间:2016/8/11 12:05:00
--  回复:(大红袍)Dim cmb1 As WinForm.ComboBox = e.F...
还是不行呢,显示给定关键字不在字典中。

我这电脑设备管理器中显示的链接端口 是 com10

--  作者:大红袍
--  发布时间:2016/8/11 12:11:00
--  

 

[此贴子已经被作者于2016/8/11 12:14:05编辑过]

--  作者:大红袍
--  发布时间:2016/8/11 12:15:00
--  

Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")

 

For Each sp As String In Ports.PortNames
    \'Ports.Add(sp)

    \'Ports(sp).Open
    cmb1.items.add(sp)
Next