The type or namespace name not found
Voila j'ai trouvé un code sur le net j'ai essayer de le comprendre et de pouvoir le lancé, mais voila je l'ai recopier, mais il me fait 2 erreur.
et je ne comprend pas
Voici les 2 erreurs
Citation:
Error 1 The type or namespace name 'FileSystemEventArgs' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\cla\Desktop\Cédric\LABCompréhension\Watcher\Watcher\CodeFile1.cs 30 49 Watcher
Error 2 The type or namespace name 'RenamedEventArgs' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\cla\Desktop\Cédric\LABCompréhension\Watcher\Watcher\CodeFile1.cs 35 49 Watcher
voici le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| using System;
using System.IO;
public class Watcher
{
public static void Main(String[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Utilisation: Watcher.exe <rpertoire>");
}
else
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = args[0];
watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.Attributes | NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.Security | NotifyFilters.Size;
watcher.Changed += new FileSystemEventHandler(OnChanged);
watcher.Created += new FileSystemEventHandler(OnChanged);
watcher.Deleted += new FileSystemEventHandler(OnChanged);
watcher.Renamed += new RenamedEventHandler(OnRenamed);
watcher.EnableRaisingEvents = true;
}
Console.WriteLine("Appuyez sur Entre pour quitter l'exemple\r\n");
Console.ReadLine();
}
public static void OnChanged(object source, FileSystemEventArgs e)
{
Console.WriteLine("Fichier: {0} {1}", e.FullPath, e.ChangeType.ToString("G"));
}
public static void OnRenamed(Object source, RenamedEventArgs e)
{
Console.WriteLine("Fichier: {0} renomm en {1}", e.OldFullPath, e.FullPath);
}
} |
Est ce que vous savez comment corriger cette erreur?
Merci d'avance