发布网友 发布时间:2022-04-22 15:47
共2个回答
热心网友 时间:2023-11-11 11:50
ThreadB.IsBackground = True '启动线程 ThreadB.Start() '创建一个读取P的线程 If ThreadP Is Nothing Then ThreadP = New Thread(New ThreadStart(AddressOf RCardP.Read)) End If '传递参数给线程 RCardP.ReaderPort = ReaderPPort RCardP.ReaderComAdr = ReaderPComAdr ThreadP.Name = "ReaderP" ThreadP.IsBackground = True '启动线程 ThreadP.Start() '创建一个读取T的线程 If ThreadT Is Nothing Then ThreadT = New Thread(New ThreadStart(AddressOf RCardT.Read)) End If '传递参数给线程 RCardT.ReaderPort = ReaderTPort RCardT.ReaderComAdr = ReaderTComAdr ThreadT.Name = "ReaderT" ThreadT.IsBackground = True '启动线程 ThreadT.Start() Catch ex As Exception MessageBox.Show(ex.Message) '还原至初始状态 initStatus() ExIT Sub End Try Else MessageBox.Show("Open ReaderB、ReaderP And ReaderT Serial Port Failure!" & Chr(13) & " These Reader Communication as follows:" & " " & Date.Now & Chr(13) & "ReaderB is :" & ReaderBCommunicationFlag & Chr(13) & "ReaderP is :" & ReadERPCommunicationFlag & Chr(13) & "ReaderT is :" & ReaderTCommunicationFlag, "Pop out reminding information", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) oIni = Nothing '还原至初始状态 initStatus() Ex
热心网友 时间:2023-11-11 11:51
我认为不行