473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

FileSystemWatcher on Remote NFS Drives

Hallo VB.NET's

We are trying to use FindFirstChangeNotification under VB6

and FileSystemWatcher with vb.net and got no success on drives mapped with
InterDriveClient (5.0,7.11) on

a NetApp NFS System.

On Local Drives the code is working.

Also on SAMBA drives it is not working.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load

watcher = New FileSystemWatcher

' watcher.Path = WatchPath.Text

watcher.NotifyFilter = NotifyFilters.FileName Or NotifyFilters.Size Or
NotifyFilters.DirectoryName

watcher.IncludeSubdirectories = True

AddHandler watcher.Changed, AddressOf OnChanged

AddHandler watcher.Created, AddressOf OnChanged

AddHandler watcher.Deleted, AddressOf OnChanged

AddHandler watcher.Renamed, AddressOf OnRenamed

watcher.EnableRaisingEvents = False

Button1.Text = "&Start Observation"

End Sub

Public Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)

MessageBox.Show(e.FullPath, "Changed triggered", MessageBoxButtons.OK,
MessageBoxIcon.Information)

' Console.WriteLine("Datei: {0} {1}", e.FullPath,
e.ChangeType.ToString("G"))

End Sub

Public Sub OnRenamed(ByVal source As Object, ByVal e As RenamedEventArgs)

MessageBox.Show(e.FullPath, "Renamed triggered", MessageBoxButtons.OK,
MessageBoxIcon.Information)

' Console.WriteLine("Datei: {0} wurde umbenannt in {1}", e.OldFullPath,
e.FullPath)

End Sub

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click

If Directory.Exists(WatchPath.Text) = False Then

MessageBox.Show(WatchPath.Text, "Directoy not exists error",
MessageBoxButtons.OK, MessageBoxIcon.Error)

Else

watcher.Path = WatchPath.Text

If (watcher.EnableRaisingEvents = True) Then

watcher.EnableRaisingEvents = False

Button1.Text = "&Start Observation"

Else

watcher.EnableRaisingEvents = True

Button1.Text = "&Stop Observation"

End If

End If

End Sub

Is this generally not working?

Are there workarounds?

Many Thanks.

A.Reisenhofer
Apr 21 '06 #1
0 1841

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cxw0106 | last post by:
Hello, I have some weird problem with the FileSystemWatcher. I have developed an application that monitors a network directory for file changes of a certain file type. The program runs well for...
1
by: brian | last post by:
Hello all. I've created a FileSystemWatcher (ASP.Net w/VB.Net code behind pages) that is to reside on Server A and monitor the activity of folder on Server B. The application works fine with...
7
by: John Bailo | last post by:
I've posted parts of problems in other posts, but I thought I'd consolidate my questions because I still don't have a solution. Problem: I want to use the creation of a file on a remote ftp...
2
by: lastusernameleft | last post by:
Is there a .NET method for doing this? I haven't found anything else that works. Thanks
6
by: deko | last post by:
In a multi-user environment, I have a table that stores hyperlinks to documents that are stored on the machine that hosts the mdb database. The table entry looks like this: ...
4
by: raghu | last post by:
Hi All Anyone help me to set multiple drives for FileSystemWatcher component. FileSystemWatcher watcher=new FileSystemWatcher(); watcher.Path = "c:\" this is working fine. If i give...
4
by: Peter Lin | last post by:
Dear all; I need to monitor a xml file so that I can update my data in hashtable, but the problem is it will trigger more than one event for a lastwrite action(I trigger this action by add...
9
by: =?Utf-8?B?THVpcyBBbnRvbmlvIFJvc2VsbG8gR2FyY2lh?= | last post by:
Hi, I have a big problem with a Visual C++ 6.0 function that retrives the logical drives and types in the local system. This function works perfectly on Windows 98, NT, 2000, XP and 2003, but I...
5
by: =?Utf-8?B?Sm9obiBT?= | last post by:
I am trying to find out if there is a way to tell if there is already a filesystemwatcher (created by a webservice) monitoring a folder. I have a webservice that creates a filesystemwatcher,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.