[.NET] 請教一段程式
請輸入專案類型(網站專案或者應用程式專案):VB
Private Sub AcceptWorkThread()
Thread.CurrentThread.IsBackground = True
While (True)
Application.DoEvents()
Dim ns As NetworkStream = tc.GetStream() 'Get Data
If ns.CanRead Then
Dim receive() As Byte = New Byte(0) {} '宣告一個陣列
ns.Read(receive, 0, receive.Length)
Dim si As SetInfo
si = AddressOf ShowMessage
Dim obj As Object() = New Object(0) {}
If TypeMode = 0 Then
obj(0) = Convert.ToChar(receive(0)).ToString()
Else
Dim strHex As String = receive(0).ToString("X")
strHex = (IIf(strHex.Length = 1, "0", "")) + strHex
obj(0) = strHex + " "
End If
Me.Invoke(si, obj)
End If
End While
End Sub
Private Sub ShowMessage(ByVal Message As String)
Dim strMessage() As String
txtReceive.Text = txtReceive.Text + Message
End Sub
其中txtReceive顯示為:
0000000000000001Volt:2.6V LQI:18
0000000000000001Volt:2.6V LQI:00
0000000000000001Volt:2.6V LQI:18
0000000000000001Volt:2.5V LQI:4C
0000000000000001Volt:2.6V LQI:5C
0000000000000001Volt:2.5V LQI:54
0000000000000001Volt:2.6V LQI:54
0000000000000001Volt:2.5V LQI:50
0000000000000001Volt:2.6V LQI:4C
0000000000000001Volt:2.6V LQI:4C
0000000000000001Volt:2.5V LQI:54
0000000000000001Volt:2.6V LQI:58
0000000000000001Volt:2.6V LQI:54
0000000000000001Volt:2.6V LQI:54
0000000000000001Volt:2.5V LQI:54
欲將上面資訊分別以lable1,lable2,lable3顯示為:
0000000000000001-----MAC Address
Volt:2.6V -----------battery life
LQI:18---------------LQI
請問如何更改程式?
感激不盡!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.126.131.44
推
08/13 10:52, , 1F
08/13 10:52, 1F