Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

FileSystemWatcher

[Solved]
  • Had to put IncludeSub Directory's to True



I have a FileSystemWatcher ( fsw1 )
And
  • Listbox 1

  • Listbox 2

  • Listbox 3

  • Listbox 4

  • Textbox1 ( Enter Path of location )

  • FolderBrowserDialog1 ( fbd1 )

  • Button1 ( Browse for path )



My Full Code :

PHP Code

<?php 
Public Class Form1

    
Private Sub fsw1_Renamed(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles Fsw1.Renamed

      ListBox1
.Items.Add("File- " & e.FullPath.ToString & " renamed at: " & System.DateTime.Now)

    
End Sub
    
Private Sub fsw1_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles Fsw1.Created

      ListBox2
.Items.Add("File- " & e.FullPath.ToString & " created at: " & System.DateTime.Now)

    
End Sub
    
Private Sub fsw1_Deleted(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles Fsw1.Deleted
      ListBox3
.Items.Add("File- " & e.FullPath.ToString & " deleted at: " & System.DateTime.Now)
    
End Sub
    
Private Sub fsw1_Changed(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles Fsw1.Changed
      ListBox4
.Items.Add("File- " & e.FullPath.ToString & " modified at: " & System.DateTime.Now)
    
End Sub

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

      fbd1
.ShowDialog()

      
TextBox1.Text = fbd1.SelectedPath

      Fsw1
.Path = TextBox1.Text

      MsgBox
("Path to monitor is now set to: " & TextBox1.Text)

    
End Sub

End 
Class 

The problem i have is with Changed events whenever I edit a text file it doesnt show "test.txt" has been edited just shows file "Test" has been modified is their anyway to do this ?
What is E, it's a tree view? Fullpath obviously doesn't return the file extension.

I don't have Visual Studio on me at the moment but try looking through the suggested codes, there is probably one that makes sense to give you your File Extension.
(Sep 17, 2015 10:27 AM)Jackie Chun Wrote:  What is E, it's a tree view? Fullpath obviously doesn't return the file extension.

I don't have Visual Studio on me at the moment but try looking through the suggested codes, there is probably one that makes sense to give you your File Extension.
Thanks for you're reply I managed to fix it now I had Include Sub Directory's to False


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by severosSep 11, 2015 04:03 PM 3 177 Sep 11, 2015 04:03 PM
Last Post: Nikey646
[.NET] by Prototype7434Mar 18, 2015 11:04 AM 11 286 Mar 18, 2015 11:04 AM
Last Post: Only3
[.NET] by Prototype7434Mar 15, 2015 06:35 AM 3 112 Mar 15, 2015 06:35 AM
Last Post: Prototype7434