Possible Duplicate:
C# get file change events
i want to track a specific file size when it reach a specific size using C#
is there a way to add event handler on file size change or do i need to run an infinite process in thread that keeps checking the file size ?
thanks
Use the
FileSystemWatcherto watch for changes to your file. When it changes, get the size. For example:When you are done watching for changes, dispose of your FileSystemWatcher.