473,385 Members | 2,243 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,385 software developers and data experts.

Using FileWatch?

Hello all!
This is what I want to do, looking the for the best way to do this.
I have a text file that gets created and placed in a folder. I would like to
have a watch for that file when it pops in that folder. But I would alway
like to have the watch active. I don't want it at Form Load, and I can't
have a button get clicked. I just would like to have when ever that file gets
put in that folder, it performs my next step. I'll be staying on one form.
How would I write this?

Thanks!

Rudy
Jul 23 '06 #1
3 2480
Hello Rudy,

See FileSystemWatcher class in MSDN, there are several samples.
This class automatically raise an event when directory/file in a directory
changes

Just create app that will be located into tray area and notify u on each
file change

RHello all!
RThis is what I want to do, looking the for the best way to do this.
RI have a text file that gets created and placed in a folder. I would
Rlike to
Rhave a watch for that file when it pops in that folder. But I would
Ralway
Rlike to have the watch active. I don't want it at Form Load, and I
Rcan't
Rhave a button get clicked. I just would like to have when ever that
Rfile gets
Rput in that folder, it performs my next step. I'll be staying on one
Rform.
RHow would I write this?
RThanks!
R>
RRudy
R>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 23 '06 #2
Thanks Michael!

I did look at the documetnation, but still couldn't get it to work right.
Then I saw there is a component of FileWatch, I set that up, works fine.

"Michael Nemtsev" wrote:
Hello Rudy,

See FileSystemWatcher class in MSDN, there are several samples.
This class automatically raise an event when directory/file in a directory
changes

Just create app that will be located into tray area and notify u on each
file change

RHello all!
RThis is what I want to do, looking the for the best way to do this.
RI have a text file that gets created and placed in a folder. I would
Rlike to
Rhave a watch for that file when it pops in that folder. But I would
Ralway
Rlike to have the watch active. I don't want it at Form Load, and I
Rcan't
Rhave a button get clicked. I just would like to have when ever that
Rfile gets
Rput in that folder, it performs my next step. I'll be staying on one
Rform.
RHow would I write this?
RThanks!
R>
RRudy
R>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 23 '06 #3
Actually, everything doesn't work fine. My watch works well, Thank you
Michael. But that text file that is being created is coming from a SQL
trigger. when the trigger runs more than once in the same session I get a
"The process can not acess the file because it's being used by another
process"
This is refering to my text file. If I run the trigger without my app, it
works fine.
What do I need to do so I can run this trigger more than once in the same
session, is there a way to refresh the process or something? FYI I'm using
VS 2003, SQL 2000.
I'm hope this make sence to somebody, cause it sure doesn't make sence to me.
LOL

TIA!!

Rudy
"Rudy" wrote:
Thanks Michael!

I did look at the documetnation, but still couldn't get it to work right.
Then I saw there is a component of FileWatch, I set that up, works fine.

"Michael Nemtsev" wrote:
Hello Rudy,

See FileSystemWatcher class in MSDN, there are several samples.
This class automatically raise an event when directory/file in a directory
changes

Just create app that will be located into tray area and notify u on each
file change

RHello all!
RThis is what I want to do, looking the for the best way to do this.
RI have a text file that gets created and placed in a folder. I would
Rlike to
Rhave a watch for that file when it pops in that folder. But I would
Ralway
Rlike to have the watch active. I don't want it at Form Load, and I
Rcan't
Rhave a button get clicked. I just would like to have when ever that
Rfile gets
Rput in that folder, it performs my next step. I'll be staying on one
Rform.
RHow would I write this?
RThanks!
R>
RRudy
R>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jul 23 '06 #4

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

Similar topics

2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
10
by: Christopher Benson-Manica | last post by:
Why can't I use a class destructor in a using declaration: using MyClass::~MyClass; ? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org ...
17
by: beliavsky | last post by:
Many of my C++ programs have the line using namespace std; but the "Accelerated C++" book of Koenig and Moo has many examples where the library names are included one at a time, for example ...
8
by: Petter Reinholdtsen | last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to compile a program using 'using namespace std;' at the top. The reason seem to be that the compiler refuses to accept 'using...
14
by: john.burton.email | last post by:
I've done some extensive searching and can't seem to find an answer to this - Is it correct to using "using" with templates, for example: using std::vector; Or do I need to specify the type...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
0
by: Rudy | last post by:
Hello all! I am having problem wih filewatch, I think. Basicly I have a trigger that creates a file. Filewatch looks for a modified date on the file, than when it see's it, it should pop up a...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.