Hi guys,
I'm trying to read an entry in an ini file; if it reads "ShowInvoiceRequiredMsg=NO" then my program is going to give the option to change that line to "ShowInvoiceRequiredMsg=YES". My code below reads the file and picks up if the option is set to 'NO' but I can't seem to modify that line to change it to 'YES'....... (in red is where I'm trying to modify this text)
Any help appreciated.
I'm trying to read an entry in an ini file; if it reads "ShowInvoiceRequiredMsg=NO" then my program is going to give the option to change that line to "ShowInvoiceRequiredMsg=YES". My code below reads the file and picks up if the option is set to 'NO' but I can't seem to modify that line to change it to 'YES'....... (in red is where I'm trying to modify this text)
VB.NET:
Dim file As System.IO.File
Dim reader As System.IO.StreamReader
Dim line As String
reader = file.OpenText("c:\file.ini")
'loop through each line
While reader.Peek <> -1
line = reader.ReadLine()
'check for specific word
If line.Contains("ShowInvoiceRequiredMsg=NO") Then
If MessageBox.Show("The Invoice Required Dialog is disabled, do you want to re-enable it?", _
"Invoice Required Dialog", MessageBoxButtons.YesNo, MessageBoxIcon.Information,_
MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then
[COLOR="Red"]line.ToString.Equals("ShowInvoiceRequiredMsg=YES")[/COLOR]
Else
Exit Sub
End If
End If
End While
reader.Close()
Last edited: