j'ai vu qu'il existe "FileSystemWatcher ", mais je sais pas comment m'y prendre
Option Strict On Public Class Form1 Dim FSW As New IO.FileSystemWatcher Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FSW.Path = "c:\test" AddHandler FSW.Created, AddressOf FichierCree FSW.EnableRaisingEvents = true End Sub Private Sub FichierCree(ByVal sender As Object, ByVal e As IO.FileSystemEventArgs) 'recuperation des donnees du fichier avec FileInfo Dim monfichier As New IO.FileInfo(e.FullPath) MessageBox.Show("un fichier vient d'etre cree :" & monfichier.CreationTime.ToLongDateString) End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFSW.EnableRaisingEvents false 'ou true