Computing.Net > Forums > Programming > VB file checking

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB file checking

Reply to Message Icon

Name: dmshiplo
Date: July 19, 2004 at 12:18:29 Pacific
OS: Windows XP Pro
CPU/Ram: Athlon XP 1700+ / 640mb
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: dmshiplo
Date: July 26, 2004 at 15:09:24 Pacific
Reply:

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


0

Response Number 2
Name: diablo2_v
Date: July 28, 2004 at 17:44:27 Pacific
Reply:

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 copy

open new file
do while not eof
counter2 = counter2 + 1
input line

if counter2 > counter then
ouput line
end if
loop


0

Response Number 3
Name: BasicDosHlp
Date: August 16, 2004 at 21:36:33 Pacific
Reply:

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 marker

or 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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB file checking

batch file coverting to VBS file www.computing.net/answers/programming/batch-file-coverting-to-vbs-file/15717.html

Send line to vbs file www.computing.net/answers/programming/send-line-to-vbs-file/15973.html

Auto tidy Desktop using .VBS file www.computing.net/answers/programming/auto-tidy-desktop-using-vbs-file/17382.html