473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Watching a file

I need to watch a specific file that updates at irregular intervals
and raise an event when an update happens (ie file date/time stamp
changes). I had heard that there is a native method in .Net for doing
just this but can't see it. Anyone able to help please?

JGD
Nov 20 '05 #1
4 1097
Check out the FileSystemWatcher class

--
Bob Powell

What's Well Formed?
http://www.bobpowell.net/currentissue.htm

Visit the GDI+ FAQ for articles, tips, tricks and code.
http://www.bobpowell.net/gdiplus_faq.htm

Read my blog
http://bobpowelldotnet.blogspot.com


"John Dann" <ne**@prodata.co.uk> wrote in message
news:cj********************************@4ax.com...
I need to watch a specific file that updates at irregular intervals
and raise an event when an update happens (ie file date/time stamp
changes). I had heard that there is a native method in .Net for doing
just this but can't see it. Anyone able to help please?

JGD

Nov 20 '05 #2
Hi,

There is a filesystemwatcher in the componets tab of the toolbox.
http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------------
"John Dann" <ne**@prodata.co.uk> wrote in message
news:cj********************************@4ax.com...
I need to watch a specific file that updates at irregular intervals
and raise an event when an update happens (ie file date/time stamp
changes). I had heard that there is a native method in .Net for doing
just this but can't see it. Anyone able to help please?

JGD

Nov 20 '05 #3
John Dann wrote:
I need to watch a specific file that updates at irregular intervals
and raise an event when an update happens (ie file date/time stamp
changes). I had heard that there is a native method in .Net for doing
just this but can't see it. Anyone able to help please?

JGD


You might check out System.IO.FileSystemWatcher(). An example can be found
here: http://abstractvb.com/code.asp?A=1081

--
N@BF

Nov 20 '05 #4
* John Dann <ne**@prodata.co.uk> scripsit:
I need to watch a specific file that updates at irregular intervals
and raise an event when an update happens (ie file date/time stamp
changes). I had heard that there is a native method in .Net for doing
just this but can't see it. Anyone able to help please?


FileSystemWatcher Class (.NET Framework)
<http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemiofilesystemwatcherclasstopic.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Christopher Harrison | last post by:
I would like to, cleanly, watch a flat file for changes (updates and the like). The file will be altered by another program... I found some example code (which actually didn't compile) on Google,...
6
by: Ajay Pal Singh | last post by:
Hi, I am creating a web service, which needs to take some actions based on the config file. I need a way to listen the changes as they occur in the config file so that the service can take...
7
by: Claire | last post by:
Im sat here watching task manager and the memory consumption of my application rising second by second. What tools are there out there for me to use to find where it's all going please? (I wish...
0
by: aure_bobo | last post by:
Hi all, I'm currently developing an ASP.NET 1.1 C# Webapp. I have some objects which contains the differents parameters of my web app. These objects are instanciated in my code, in a static...
2
by: Stu | last post by:
Hi, I have been asked to interface with an AIX system running a COBOL application. Not having done this before we settled on text files written to a drive to communicate between the two systems....
8
by: Gordon Airporte | last post by:
I'm trying to find a way to take a file that another program has opened and writes to periodically, open it simultaneously in Python, and automatically update some of my objects in Python when the...
11
by: jcor | last post by:
Can anyone give me some help, plz I want to create a perl script to be watching a folder. Everytime a new file gets there it triggers some code; How can I do this? TIA, Joćo Correia
14
by: Zed A. Shaw | last post by:
Hi Everyone, Just putting out an announcement that I've released a new version of Vellum numbered 0.16. This version should be ready for people to use as not much of the internal structure has...
5
by: Andrew Cooper | last post by:
I've got an application that I'm modifying and the client needs it to watch a particular file and then do some stuff when that file gets modified. For example, let's say the file is C:\Test.dat...
3
by: canabatz | last post by:
Hi all i got a page that is refreshing data in a grid every 4 seconds and displaying results from the database and check if something as changed! my question is if there is 100 users that is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.