Hi Everyone
I'm trying to use Visual Basic.net 2015 to programming app to use it to split data logger record and store in into array, then use any operations with them...
but the problem is when i try to transfer string between variable i get an error
sell the source code below.
Code:Imports System.Text Imports System.IO Public Class Form1 Dim path As String = Nothing Dim splited() As String Dim buffer() As String Dim truec() As String Dim ic As Integer Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim FileReader As StreamReader Dim results As DialogResult results = OpenFileDialog1.ShowDialog If results = DialogResult.OK Then FileReader = New StreamReader(OpenFileDialog1.FileName) Document.Text = FileReader.ReadToEnd() FileReader.Close() End If End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button2.Click ic = 0 splited = Document.Text.Split(";") MsgBox(splited.Count) MsgBox(splited(4)) buffer = splited(0).Split(",") Label1.Text = buffer(0) Label2.Text = buffer(1) For i As Integer = 0 To splited.Count - 2 buffer = splited(i).Split(",") If buffer(0) = "ROOM_ON" Then MsgBox(buffer(1)) truec(0) = buffer(1) ic = ic + 1 End If Next i End Sub End Class
the source code in the attachment contain vb.net source code and text file




Reply With Quote
