Hi all
i have a FileSystemWatcher script that i want to port to homeseer
i try some things but i get alway an error identifier expected..
this is the script.
hope someone can help me
i have a FileSystemWatcher script that i want to port to homeseer
i try some things but i get alway an error identifier expected..
this is the script.
hope someone can help me
PHP Code:
Imports System.IO
Imports System.Diagnostics
dim watchfolder As FileSystemWatcher
Sub Main(ByVal Parms As Object)
watchfolder = New System.IO.FileSystemWatcher()
watchfolder.Path = "C:\test\"
watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
IO.NotifyFilters.FileName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
IO.NotifyFilters.Attributes
AddHandler watchfolder.Changed, AddressOf logchange
AddHandler watchfolder.Created, AddressOf logchange
AddHandler watchfolder.Deleted, AddressOf logchange
AddHandler watchfolder.Renamed, AddressOf logrename
watchfolder.EnableRaisingEvents = True
End Sub
Private Sub logchange(ByVal source As Object, ByVal e As _
System.IO.FileSystemEventArgs)
If e.ChangeType = IO.WatcherChangeTypes.Changed Then
hs.writelog("File " & e.FullPath & _
" has been modified" & vbCrLf)
End If
If e.ChangeType = IO.WatcherChangeTypes.Created Then
hs.writelog("File" & e.FullPath & _" has been created" & vbCrLf)
End If
If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
hs.writelog("File " & e.FullPath & _
" has been deleted" & vbCrLf)
End If
End Sub
Public Sub logrename(ByVal source As Object, ByVal e As _
System.IO.RenamedEventArgs)
hs.writelog("File" & e.OldName & _
" has been renamed to " & e.Name & vbCrLf)
End Sub