这是我的启动程序,当路径是 "\172.27.128.41\Public"时,目录下的swath5578\tape5913文件夹重的文件增加不能监控到,再本地计算机上就可以。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Start.Click
If Start.FlatStyle = FlatStyle.Standard Then
FileSystemWatcher1.Path = "\\172.27.128.41\Public\swath5578\tape5913"
'FileSystemWatcher1.Path = "\\172.27.128.41\Public\"
FileSystemWatcher1.NotifyFilter = NotifyFilters.Attributes Or
NotifyFilters.CreationTime Or
NotifyFilters.DirectoryName Or
NotifyFilters.FileName Or
NotifyFilters.LastAccess Or
NotifyFilters.LastWrite Or
NotifyFilters.Security Or
NotifyFilters.Size
FileSystemWatcher1.Filter = "*.*"
Start.Text = "Stop"
FileSystemWatcher1.IncludeSubdirectories = True
FileSystemWatcher1.EnableRaisingEvents = True
Start.FlatStyle = FlatStyle.Flat
Start.BackColor = Color.LawnGreen
ElseIf Start.FlatStyle = FlatStyle.Flat Then
Start.Text = "Start"
Start.FlatStyle = FlatStyle.Standard
Start.BackColor = Color.Gainsboro
End If
End Sub