...
Dim streamInput = File.OpenInput(Path, filename)
Dim streamOutput = File.OpenOutput(Path,filename,False)
Dim tr As TextReader
Dim tw As TextWriter
tr.Initialize(streamInput) ' or intalize2 if encoding is needed, for example r.Initialize2(streamInput, "ISO-8859-1")
tw.initialize(streamOutput) ' or initailize2
Dim strLine As String
strLine = tr.ReadLine
Do While (strLine <> Null)
If not (linetodelete) Then
tw.WriteLine(strLine)
End If
strLine = tr.ReadLine
Loop
tw.Close
tr.Close
...