FileSystemWatcher class

  • Thread starter Thread starter stefano_mi74
  • Start date Start date
S

stefano_mi74

hi all,
I'm using VS2005 to develop my smart device application for windows
ce. Is there a FileSystemWatcher class or an equivalent method to
listen in my folder when a file is created ?
In internet there is a OpenNetCF package but is not free.

thanks
stefano
 
The community edition is free
(http://www.opennetcf.com/CompactFramework/Products/SmartDeviceFramewo...).
You get everything minus the source code and the designer additions. Nothing
which would hinder you from using the FileSystemWatcher.

Peter

--
Peter Foot
Microsoft Device Application Development MVPwww.peterfoot.net|www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility







- Mostra testo tra virgolette -

thanks for your answer ..
Is it possible that this object is not fired event when create in the
path file or folder ?
my code:
FileSystemWatcher fs = new FileSystemWatcher(@"\");
fs.Created += new
FileSystemEventHandler(this.fileSystemWatcher1_Created);

private void fileSystemWatcher1_Created(object sender,
FileSystemEventArgs e)
{
System.Diagnostics.Debug.WriteLine("ciao");
}
 
You need to set
fs.EnableRaisingEvents = true;
also set the notify filters to the types of change you want to watch:-
fs.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite |
NotifyFilters.FileName | NotifyFilters.DirectoryName;

It follows the same design as the version in the full .NET framework so you
can check out the help files for examples.

Peter
 
You need to set
fs.EnableRaisingEvents = true;
also set the notify filters to the types of change you want to watch:-
fs.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite |
NotifyFilters.FileName | NotifyFilters.DirectoryName;

It follows the same design as the version in the full .NET framework so you
can check out the help files for examples.

Peter

--
Peter Foot
Microsoft Device Application Development MVPwww.peterfoot.net|www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility







- Mostra testo tra virgolette -

ok, but If I call fs.EnableRaisingEvents = true; my program crash
"Impossibile trovare la DLL PInvoke 'aygshell.dll'." --- Impossible
found DLL Pinvoke 'aygshell.dll'.
Why ?
 
I've already explained this. Try to keep your questions on a single topic
in 1 thread so people can follow them and archive searches can turn up more
meaningful results.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Back
Top