I am developing a program where I will save the information from a "Log file" from an external application..

example:
I have a biometrics system that reads and saves the log file to disk,
once the user logs to the system, the system will save the file to a log file after that the system that i will develop will read the data from the "log file"(probably a text file) and send it to sql server

what event should I use?, I heard about Environment Variables and they say that this would help..

any suggestions??

I don't see how environment vars are going to help you, unless the biometrics system sets one to something when the user logs in.

I'd go with the date modified of the "log file". Use a timer to run every x mins and check if the file has been modified "recently" (you'll be the judge of what recently means).

PS: Have you tried to open the "log file" with a notepad or something when being written by the biometrics system? Are you sure that you'll be able to access it at the same time that the system will be writing on it ?

I don't see how environment vars are going to help you, unless the biometrics system sets one to something when the user logs in.

I'd go with the date modified of the "log file". Use a timer to run every x mins and check if the file has been modified "recently" (you'll be the judge of what recently means).

PS: Have you tried to open the "log file" with a notepad or something when being written by the biometrics system? Are you sure that you'll be able to access it at the same time that the system will be writing on it ?

uh yeah the log file can be opened by a notepad, I just don't want any dupes with the data, so i'm thinking of only writing the last data from the text file to sql, but there's only a "what if", yeah what if I set the interval of timer to 1 second, that will keep my program to save and save and save, and keep duplicating records.. uhm, hey should I check the database for existing data and my lookup is "date modified" then save the file only when the data is not existing..

If you don't trust the data, then don't mix them.
Insert them to a new table and after you've checked them and "sanitized" them, insert what you want/need into your table with the "safe" or "checked" data.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.