Click here to Skip to main content
15,919,879 members
Home / Discussions / C#
   

C#

 
AnswerRe: 3 state Button - weird behaviour Pin
Christian Graus4-Oct-06 9:36
protectorChristian Graus4-Oct-06 9:36 
AnswerRe: 3 state Button - weird behaviour [modified] Pin
Ilíon4-Oct-06 9:59
Ilíon4-Oct-06 9:59 
Questionfile system watcher problem Pin
gus_br4-Oct-06 8:39
gus_br4-Oct-06 8:39 
AnswerRe: file system watcher problem Pin
Andrew Rissing4-Oct-06 11:42
Andrew Rissing4-Oct-06 11:42 
GeneralRe: file system watcher problem Pin
gus_br4-Oct-06 14:04
gus_br4-Oct-06 14:04 
GeneralRe: file system watcher problem Pin
Andrew Rissing5-Oct-06 4:27
Andrew Rissing5-Oct-06 4:27 
GeneralRe: file system watcher problem Pin
gus_br6-Oct-06 7:03
gus_br6-Oct-06 7:03 
AnswerRe: file system watcher problem Pin
Andrew Rissing6-Oct-06 7:25
Andrew Rissing6-Oct-06 7:25 
Well, its because you're moving the file back into its same location and firing the event again I assume from the FileSystemWatcher. Then, because you're doing that within the event handler, it causes it to repeat the process forever.

I would first ask you this:

1) Are you attempting to monitor only one file at most?
2) Will the file be modified across a network potentially?

If the file is being updated across a network, you can quickly get numerous events called due to the fact that the file is written in chunks and each chunk fires off an event.

3) Are you attempting to move the file into another location, which will not produce an event?

The FileSystemWatcher has an internal buffer, which if too many events occur within a set amount of time, it will be overrun. Meaning, you'll lose events that you should have received. The best way to avoid this is to fire off another thread (ThreadPool works great here) to handle the job. If what you're doing is pretty minimal within the event handler or you're not handling too many files at a time, this should not be an issue. But I just wanted to make you aware of that problem.
QuestionDllImport / PInvoke Problem? Pin
David Knechtges4-Oct-06 8:18
David Knechtges4-Oct-06 8:18 
AnswerRe: DllImport / PInvoke Problem? Pin
Ed.Poore4-Oct-06 11:11
Ed.Poore4-Oct-06 11:11 
GeneralRe: DllImport / PInvoke Problem? Pin
David Knechtges5-Oct-06 7:32
David Knechtges5-Oct-06 7:32 
QuestionGTK# deployment - an installer project. Pin
P85Dyer4-Oct-06 7:47
P85Dyer4-Oct-06 7:47 
QuestionGrouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:14
tntomek4-Oct-06 7:14 
AnswerRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 7:17
LongRange.Shooter4-Oct-06 7:17 
GeneralRe: Grouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:38
tntomek4-Oct-06 7:38 
AnswerRe: Grouping Array of Objects by Properties Pin
Nicholas Butler4-Oct-06 8:45
sitebuilderNicholas Butler4-Oct-06 8:45 
GeneralRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 14:29
LongRange.Shooter4-Oct-06 14:29 
QuestionSorting a listview from an array. Pin
teejayem4-Oct-06 6:10
teejayem4-Oct-06 6:10 
AnswerRe: Sorting a listview from an array. Pin
aamironline4-Oct-06 6:38
aamironline4-Oct-06 6:38 
AnswerRe: Sorting a listview from an array. Pin
Eric Dahlvang4-Oct-06 6:39
Eric Dahlvang4-Oct-06 6:39 
QuestionHow to get two child classes to access a third class Pin
Muntyness4-Oct-06 5:12
Muntyness4-Oct-06 5:12 
AnswerRe: How to get two child classes to access a third class Pin
Le centriste4-Oct-06 5:22
Le centriste4-Oct-06 5:22 
AnswerRe: How to get two child classes to access a third class Pin
led mike4-Oct-06 5:22
led mike4-Oct-06 5:22 
AnswerRe: How to get two child classes to access a third class Pin
aamironline4-Oct-06 5:23
aamironline4-Oct-06 5:23 
AnswerRe: How to get two child classes to access a third class Pin
Muntyness4-Oct-06 5:39
Muntyness4-Oct-06 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.