我正在使用visual basic 2010.我有以下格式的數據字符串。我想分割逗號分開的值並將其放入單獨的文本框中。For The last Temp_read:348 ,HV_Read:647,SPD:0,DIS:0」我想單獨拆分值並付諸文本框中分割字符串並將值放入文本框
可以有人建議我,我怎麼能做到這一點是有示例代碼
。Public Class Form1
Dim selectedItem1 As String
Dim Data As String
Private Sub SMCB1_clientIP_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SMCB1_clientIP.TextChanged
End Sub
Private Sub SMCB1_Connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SMCB1_Connect.Click
Dispay_Show.Text = SMCB1_clientIP.Text
Dispay_Show.Text = SMCB1_clientIP.Text & vbNewLine & SMCB1_Port.Text & vbNewLine
Data = "SMCB3,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Temp_read:348,HV_Read:647,SPD:0,DIS:0"
Dispay_Show.Text = SMCB1_clientIP.Text & vbNewLine & SMCB1_Port.Text & vbNewLine & Data
Data.Split()
End Sub
Private Sub SMCB1_Disconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SMCB1_Disconnect.Click
End Sub
End Class
Data =「SMCB3,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,Temp_read:348,HV_Read:647,SPD:0,DIS:0「
你能指定你正在尋找你添加的圖像的預期輸出嗎? – Siva