Solved

Trouble with filesystemwatcher

Posted on 2014-01-16
2
197 Views
Last Modified: 2014-01-16
I'm creating a filewatcher, and even though I set the filter to a specific file extension, the rename event is triggered when the file is changed 'from' that extension that I'm looking for.

Do I have to capture this in my rename event too?

Example:
I'm watching for .filter "*.ABC"

If I rename file.ABC to file.DEF, the rename event is fired.
I only want to process the file if a file is renamed 'to' *.ABC

I know it's possible to simply check that file extension in the rename event, but I wasn't sure if I was overlooking some other setting...
0
Comment
Question by:sirbounty
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 39786124
Sorry for you, but the FileSystemWatcher does not have an option for ExtensionChanged.

What you could do, if you are at ease with the concept, is to build a class that inherits from FileSystemWatcher and code it to add the necessary option.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39786158
I'll just create a fileinfo reference and check the extension that way then...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tool Box 2 35
Export import database 4 44
Point to Current Row Ater Refresh Datagridview 3 21
Not seen Link button 5 19
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now