Thanks Chris,
The problem I am experiencing was basically which way to go. I had not
coded anything as yet to read the file, but now you have said StreamRead will
suit my needs I will delve into this an try to put some code together.
For the few projects I have done I have used
myfileobject.opentextfile(c:\.......)
I see in help there is an example of StreamRead:
' Open the stream and read it back.
fs = File.Open(path, FileMode.Open, FileAccess.Read)
Dim b(1024) As Byte
Dim temp As UTF8Encoding = New UTF8Encoding(True)
Do While fs.Read(b, 0, b.Length) 0
Console.WriteLine(temp.GetString(b))
If I run into problems with it then you will no doubt hear from me.
Thanks for the prompt response, I will start tomorrow with fresh eyes.
--
Kind Regards
John.
"Chris Dunaway" wrote:
John please don't spam me! wrote:
VB.Net 2003
Hi,
2 questions:
1. I want to read a file in without locking it, as it is Log file.
2. I want to be able to read from the last point it wa read upto.
The project is:
Search through ftp log files for certain files download to our ftp site.
This will be on a schedule so I would like to pass to my database the point
(in bytes) where I have read upto. Then next time I check it I want to only
ready from the amount of bytes recalled from the database.
What have you tried and what problems are you having? The StreamReader
can be used to read the file as well as opening it for read access only
without locking it. Also, it allows for seeking into the file to a
certain point.
What problem are you experiencing?