whizbang Posted December 14, 2003 Posted December 14, 2003 I'm very new to VB.Net, and have done a bit of googling for info on the subject, but was only able to turn up some stuff on VB6 which didn't seem too helpful or relevant with .NET Basically what I want to do is write a small program to read data from a legacy Windows app for managing point of sale terminals. The app starts writing a new text file every day. During the day as sales occur at a POS terminal, the data flows to this Windows app which then writes the data out to a text file. I need to figure a way to open the text file for reading, process each line or transaction and get out the data I want, and then stay waiting with the file open and waiting for new data... doesn't have to be realtime, but it would be nice to keep any delay of new data written to the text file and read by my program to a minimum. A thought I had was maybe once finished processing the file, keep a note of it's filesize, and then keep checking every second if the size has changed, if so then read in the new data in the file. As I say tho, I'm new to VB and really unsure of what it offers... I've got some VB.Net books on the way (hopefully arrive next week) to help me. Does anyone have some code that might do what I'm after or be able to point me in the right direction as to how to achieve what I want? Cheers Quote
tate Posted December 14, 2003 Posted December 14, 2003 Check out the StreamReader and StreamWriter classes. Utilizing these two and all of the text string properties and methods should give you a good start. Quote
*Experts* mutant Posted December 14, 2003 *Experts* Posted December 14, 2003 Also, you can use the FIleSystemWatcher component to look for file changes. It would be the best method. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.