Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
ok, i need help figuring something out in visual basic. what i want to do is i want to write a program that can read a standard text file, and figure out if anything new has been added to this file since the last time it checked it.
i was figuring that first it would check (this is the part i need the most help with, because my current understanding of reading files is "Open 'whatever' for Input as #1", that sorta thing), and then it would copy this file to another location to use as a comparison for the next time it checks. i then want the program to be able to display whats new to the end of this file (ie, whether someone has appended something to it), and id like it look for certain words.
now, your probably wondering what this is for. i want to be able to have an action performed when certain key words are typed. i have a keylogger running, and it writes the log to a text file. im trying to write a program that will read and interpret this log file.
sorry if ive been a little vague, but any help you can give would be welcomed
thanks,
Dave

k, im still trying here. ive gotten it to copy the old file, but i still need a way of comparing the two, and finding certain new words
any help would be great
thanks,
Dave

It's been awhile since i've used vb, so bear with me.
The way I understand you is that the keylogger keeps adding information to the end of a file.
So you should be able to find out how many lines are in the copied file, and then check if the new file has more.
open file copy
do while not eof
counter = counter +1
input line
loop
close file copyopen new file
do while not eof
counter2 = counter2 + 1
input lineif counter2 > counter then
ouput line
end if
loop

Not sure how your opening the file to read it
But here are a few ideas
why not append time/date commmand into the text file each time you open it as a markeror make a seperate text file with a time date and line count for each time the file is opened
My Page has many quick explainations of basic commands
Feel free to contribute Or enlighten me with code examples that are not on my page
I am particularly interested in learning hardware periph

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |