Here you go...
Private Sub logchange(ByVal source As Object, ByVal e As
System.IO.FileSystemEventArgs)
If e.ChangeType = IO.WatcherChangeTypes.Changed
Then
txt_folderactivity.Text &= vbCrLf & strUser
& " on " & strComputer & " - File " & e.FullPath & _
" has been modified - " & Now()
SaveTextToFile
(txt_folderactivity.Text, "c:\Log.txt")
End If
If e.ChangeType = IO.WatcherChangeTypes.Created
Then
txt_folderactivity.Text &= vbCrLf & strUser
& " on " & strComputer & " - File " & e.FullPath & _
" has been created - " & Now()
SaveTextToFile
(txt_folderactivity.Text, "c:\Log.txt")
End If
If e.ChangeType = IO.WatcherChangeTypes.Deleted
Then
txt_folderactivity.Text &= vbCrLf & strUser
& " on " & strComputer & " - File " & e.FullPath & _
" has been deleted - " & Now()
SaveTextToFile
(txt_folderactivity.Text, "c:\Log.txt")
End If
End Sub
Public Sub logrename(ByVal source As Object, ByVal e
As System.IO.RenamedEventArgs)
txt_folderactivity.Text &= vbCrLf & strUser & "
on " & strComputer & " - File " & e.OldName & _
" has been renamed to " & e.Name & vbCrLf
SaveTextToFile
(txt_folderactivity.Text, "c:\Log.txt")
End Sub
-----Original Message-----
* "Iceman" <an*******@discussions.microsoft.com> scripsit: I am logging things to a file but when I kill the app
and restart it, all the other logging is gone. How can I
prevent this form happening?
.... by posting the code you use for writing the file.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
.