window service
-
i want to create one window service for watching a file. whenever file content change i want to get new data, which is just comes to file. how can i do this. there is any way to do this??
yogesh
-
i want to create one window service for watching a file. whenever file content change i want to get new data, which is just comes to file. how can i do this. there is any way to do this??
yogesh
Need more information. Is it a text file to which additional data is added at the end, like a log file? I've written a Windows Service to do that.
-
Need more information. Is it a text file to which additional data is added at the end, like a log file? I've written a Windows Service to do that.
yes that is a text file. whenever new data comes to file, i want to perform some action through window service. please help me sir,
yogesh
-
yes that is a text file. whenever new data comes to file, i want to perform some action through window service. please help me sir,
yogesh
I had the service running on a thirty* second cycle; on each cycle it would: 0) Open the file 1) Seek to the position where it had read to on the last read 2) Read to the end of the file 3) Close the file 4) Store the new position There were a number of other challenges to overcome, including being sure that it read only complete lines. Your requirements may vary. * Configurable.
-
I had the service running on a thirty* second cycle; on each cycle it would: 0) Open the file 1) Seek to the position where it had read to on the last read 2) Read to the end of the file 3) Close the file 4) Store the new position There were a number of other challenges to overcome, including being sure that it read only complete lines. Your requirements may vary. * Configurable.
could u give me code for that????
yogesh
-
could u give me code for that????
yogesh
It wouldn't be much use to you; it's very specific to one situation. But with what I've said so far and an article on writing a Windows Service you should have a working version by the end of the week.
-
Need more information. Is it a text file to which additional data is added at the end, like a log file? I've written a Windows Service to do that.
Create a Windows service and use the FileSystemWatcher class. You will get an event every time your file has been changed. Patrik
-
Create a Windows service and use the FileSystemWatcher class. You will get an event every time your file has been changed. Patrik
That might be suitable for the OP's requirements, but not mine.