For intArray = 0 To UBound(array) mfswBill(intArray) = New System.IO.FileSystemWatcher With mfswBill(intArray) .Path = array(intArray) 'すべてのファイルを監視 .Filter = "*.*" 'イベントハンドラの追加 AddHandler mfswBill(intArray).Created, AddressOf watcher_Changed 'サブディレクトリも監視できるようにする .IncludeSubdirectories = True '監視を開始する .EnableRaisingEvents = True End With Next End Sub Private Sub watcher_Changed() MsgBox("追加されました") End Sub
For intArray = 0 To UBound(array) mfswBill(intArray) = New System.IO.FileSystemWatcher With mfswBill(intArray) .Path = array(intArray) 'すべてのファイルを監視 .Filter = "*.*" 'イベントハンドラの追加 AddHandler mfswBill(intArray).Created, AddressOf watcher_Created 'サブディレクトリも監視できるようにする .IncludeSubdirectories = True '監視を開始する .EnableRaisingEvents = True End With Next End Sub Private Sub watcher_Created() MsgBox("追加されました") End Sub
と変更しましたが
>相手のサーバーが、変更通知をサポートしているかどうかを確認しておいてください。
>SD カードといったメディア媒体というよりは、その「ファイル共有」のサービスを提供する、複合機のソフトウェア(サーバー)次第です。 Windows に対して変更を通知するような設計・実装になっていなければ、変更を検知することはできないと思われます。
説明書など見ましたが変更が検知するかどうかが調べれませんでした。
>64bit OS で開発している場合、Load イベントを使っていると、 >デバッグ時の例外を取りこぼしやすいので御注意ください。