Results 1 to 6 of 6

Thread: [RESOLVED] VS.NET 2015 getting System.NullReferenceExcept while trying to transfer Strings

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    11

    Resolved [RESOLVED] VS.NET 2015 getting System.NullReferenceExcept while trying to transfer Strings

    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.

    Name:  1.jpg
Views: 338
Size:  35.7 KB

    Name:  2.jpg
Views: 308
Size:  34.0 KB

    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
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width