Questions tagged [filesystemwatcher]

FileSystemWatcher is a .NET component class that listens to the file system change notifications and raises events when a directory, or file in a directory, changes.

The System.IO.FileSystemWatcher component class can be used in .NET applications to watch for changes in a specified directory. You can watch for changes in files and subdirectories of the specified directory. These changes can be observed on a local computer, a network drive, or a remote computer.

The Filter property can be set with a string value indicating which files and/or directories are to be watched for changes.

1220 questions
-1
votes
1 answer

Backing up multiple files then clearing it

I already have a windows service with a filesystemwatcher that checks for any file that has been changed (e.g. size). If a logfile has reached 1mb, it will be copied into another folder and the original logfile will be cleared. I made a windows form…
-2
votes
1 answer

FileSystemWatcher: aggregate multiple filter events into a single one?

Take the following code, the events raised by the watcher all call the same method: [NonSerialized] private FileSystemWatcher Watcher; private void WatcherInit() { Watcher ??= new FileSystemWatcher(); Watcher.Path =…
aybe
  • 15,516
  • 9
  • 57
  • 105
-2
votes
1 answer

FileSystemWatcher on separate thread

I have to create script which will push some files into provided location and grab the output generated by other script. Copy files to location. Other script will grab the files and process them. Wait for all results. Get data from files, remove…
-2
votes
1 answer

Powershell FileSystemWatcher stops notifications after some time

I have a simple powerscript which watch for a folder for new file addition. The script is watching a root folder. This root folder has multiple sub folders. User can copy a file to any of these sub folders and script will send notification to the…
user1386121
  • 91
  • 3
  • 13
-2
votes
1 answer

FileSystemWatcher with a background thread is missing to move files

I have a simple requirement of moving files from source folder to destination folder. The files are about 5mb in size and arrive three at a time (every 5 seconds). The current mechanism I have in place seems to move files however if the…
Abe
  • 1,879
  • 2
  • 24
  • 39
-2
votes
1 answer

Create multiple FileSystemWatcher instances dynamically

I have a filesystemwatcher written from examples found here that is working fine, along the lines: Public monitor As FileSystemWatcher monitor = New System.IO.FileSystemWatcher() monitor.Path = c:\temp\ monitor.NotifyFilter =…
Andrew
  • 1,006
  • 10
  • 17
-2
votes
1 answer

Out of memory exception caused by FileSystemWatcher

I am trying to load an image and performing some process on it each time when an new image was create in a folder. The code ran fine in the debugging mode. However, when I copied the executable folder to the target machine. The FileSystemWatcher…
Stephen127
  • 305
  • 2
  • 3
  • 10
-2
votes
1 answer

Process is started twice in the OnChanged event

I Have created a program to watch a notepad file using filewatcher.. whenever the text in the file changes.. I made a .exe program to run... the .exe program also runs properly.. But it runs twice... I searched Stackoverflow and also other…
Kopika
  • 122
  • 15
-2
votes
1 answer

VB.NET FileSystemWatcher - Copy created file

^^^ That answer is in C#! I am using VB.NET! ^^^ I am using a FileSystemWatcher to monitor a folder for new files. This sub gets triggered when it detects a change, which should then copy the file to the server. Private Sub OnCreated(source As…
MRC
  • 555
  • 2
  • 10
  • 30
-2
votes
2 answers

C#:How to program a service that changes the icon of a folder based on the content?

I want to make a program that runs as a service and changes the folder icon based on its foldercontent, like svn does. And I also want to change the icon and the behavior of a folder if the name is example.someextension . How may I programmatically…
LostPhysx
  • 3,573
  • 8
  • 43
  • 73
-2
votes
1 answer

Using StreamWriter and FileSystemWatcher Together

I have a program that is monitoring a directory for changes using the FileSystemWatcher class. I have some other clients writing to this directory using a StreamWriter. "Sometimes", in the filesystemwatcher created event, when I try to access the…
swiftgp
  • 997
  • 1
  • 9
  • 17
-3
votes
1 answer

Is there any way to monitor access of files in c#?

I tried using FileSystemWatcher and NotifyFilter (using lastaccess).. But it didn't work... i want is that when a file will be opened either text or image or anything it should fire an event. Thank you.
-3
votes
2 answers

How to Monitor a Folder for files and move said files to another folder while running in background?

I want a program that will constantly monitor a folder for files, when a file appears in said folder the program should wait for the file to be accessible and then move said file to another folder. Currently the files are not being moved from folder…
John Linaer
  • 15
  • 1
  • 6
-3
votes
1 answer

async and await code behaving differently if we run it from different processes

Please bear with me for this long question. Scenario: I have a FileSystemWatcher on the root-directory which is watching for LastWrite change on control-file each inside a control-directory. Looks something like this:- root-directory…
-3
votes
1 answer

FileSystemWatcher doesnt work properly WPF

FileSystemWatcher does not work properly. It only responds when the first change occurs. If I then change a second file, nothing happens. public class ImageViewModel : INotifyPropertyChanged { public static ImageViewModel singletonInstance {…
Guilian
  • 129
  • 1
  • 11
1 2 3
81
82