none
filesystemewatcher ne fonctionne pas RRS feed

  • Question

  • Bonjour j'ai un filesysteme watcher mais quand je lance ma windows form ca ne fonctionne pas.

    ci dessous mon code:

    Imports System.IO
    Public Class Form1

        Private Sub FileSystemWatcher1_Changed(sender As Object, e As IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed
            MsgBox("un fichier changé")

        End Sub

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'System.Diagnostics.Process.Start("H:\2019\Placements hebdo - Pointages\Tableau accueil\Tableau affichage.xlsm")
            MsgBox(FileSystemWatcher1.Filter)
        End Sub

        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim filePath1 As String
            Dim num As Integer
            num = DatePart("WW", Now, vbSunday, vbFirstJan1)
            filePath1 = "PlacementsABC s" & num & "2019.xlsm"


            FileSystemWatcher1.Filter = Path.GetFileName(filePath1)

        End Sub
    End Class

    mardi 23 juillet 2019 14:30

Réponses