Hi,
You have to read in each line from the file. Recreate the file with
only the lines you want in the file back to it.
ini file class
http://www.mentalis.org/soft/class.qpx?id=6
Ken
------------------
"Joe Delphi" <delphi561@nospam.earthlink.net> wrote in message
news:5jLpe.1399$jX6.220@newsread2.news.pas.earthli nk.net...
Hi
Newbie to VB.Net and I have a question
I need to open a text file, read each line, and if I find something in
the line, delete that line from the text file. Can anyone tell me how to
do this. Some of my code is below:
Try
FileOpen(254, "FormSettings.ini", OpenMode.Input)
Do Until EOF(254)
LineOfText = LineInput(254)
FormName = LineOfText.Substring(0, LineOfText.IndexOf("_") -
1)
If FormName = Me.Name Then
(Delete the line from the file somehow......)
Exit Do
Else
FormNameExists = False
End If
Loop
Catch ex As Exception
MsgBox("Error reading FormSettings.ini file")
Finally
FileClose(254)
End Try
Also, is there any method in VB.NET for handling .ini files?
Any help appreciated
JD