Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

filesystemwatcher on  98

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trapulo - 19 May 2004 09:42 GMT
Is there any way to use filesystemwatcher on windows 98/me? Any workaround
to write a software that uses it on win2K/xp and some other solution on
98/me?

I need to receive an event when a new file is created.

thanks
"Jeffrey Tan[MSFT]" - 20 May 2004 03:33 GMT
Hi Trapulo,

Based on my understanding, you want to be notified when the file system on
Win98/Me is changed.

Yes, you can not use FileSystemWatcher class, because internally,  it
encapsulates ReadDirectoryChangesW Win32 API, which only existed on WinNT
series OS.

In Win98/Me, I think you may P/invoke win32 API FindFirstChangeNotification
to get what you want, for more information, please refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base
/findfirstchangenotification.asp

and a sample at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base
/obtaining_directory_change_notifications.asp

==============================
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Trapulo - 20 May 2004 09:23 GMT
> Hi Trapulo,
>
> Based on my understanding, you want to be notified when the file system on
> Win98/Me is changed.

Yes.
In fact I need only the be notified when a file is created, because then I
process and delete it.

> Yes, you can not use FileSystemWatcher class, because internally,  it
> encapsulates ReadDirectoryChangesW Win32 API, which only existed on WinNT
> series OS.

I understand.

> In Win98/Me, I think you may P/invoke win32 API FindFirstChangeNotification
> to get what you want, for more information, please refer to:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base
> /findfirstchangenotification.asp
>
> and a sample at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base
> /obtaining_directory_change_notifications.asp

Thanks.
As workaround I've implemented a thread that readd directory and then sleep
for a while, with internal state to avoid raising multiple events for same
file. Now I see if is it better to switch to p/invoke based implementation.

bye
"Jeffrey Tan[MSFT]" - 21 May 2004 02:09 GMT
Hi Trapulo,

Thanks for your feedback.

Yes, using timer control may meet your need if you do not need much
precision. If you need further help, please feel free to post. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.