Hi All,
I have a text document that am pulling infomation out of.
i only want to collect the information after the = sysmbol which is on each line.
here is the code so far
Dim FileName As String = "C:\test.txt"
Dim TextFromTheFile As String ' Whole text
Dim Lines() As String ' File splitted to lines
Dim LineSeparator() As String = {Environment.NewLine} ' Line separator 'character'
' Use My namespace
If My.Computer.FileSystem.FileExists(FileName) Then
' Read the file
TextFromTheFile = My.Computer.FileSystem.ReadAllText(FileName)
' Get lines. I used StringSplitOptions that removes empty lines
Lines = TextFromTheFile.Split(LineSeparator, System.StringSplitOptions.RemoveEmptyEntries)
' Now you have Lines() array ready
Me.TextBox1.Text = Lines(0)
'TextBox2.Text = Lines(1)
' and so on...
Else
' The file not found error
MessageBox.Show("File Does Not Exist", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
lines(0) now contains server=localhost
i only want to show localhost
lines(1) contacts database=maintsystem and i only want to collect maintsystem
is this even possible?