1
我用微软的COM控件6.0应用程序将数据发送到LED控制vb.net毫秒COMM越来越例外
MSComm1.EOFEnable = True
MSComm1.SThreshold = 100
MSComm1.InputLen = 0
MSComm1.RThreshold = 1
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
MSComm1.NullDiscard = False
MSComm1.CommPort =1
MSComm1.PortOpen = True <-Getting exception to this line
......
我从HRESULT歌厅异常:0x800A1F45。为什么做这个端口是不是开放。 当我通过vb6运行它时,我不会收到错误...任何人都可以帮助我...
为什么在.NET应用程序中使用旧的东西?为什么不使用.NET API直接处理COM端口? –
@JohnSaunders你能否建议更好的.NET API与COM端口通信 –
请参见[SerialPort类](http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx)。并且不要在.NET中使用任何VB6的东西。它已经超过十年了! –