Bonjour,
Je voudrai faire un petit chat. Les utilisateurs ecrivent dans un fichier text.
Il faut que celui ci se charge sur les logiciels lorsqu'il y a un nouveau message. Enfin je sais comment faire tout ca mais voyez plutot :
J'ai l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public Form1() { InitializeComponent(); FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = path + "talkboxtxt"; watcher.NotifyFilter = NotifyFilters.LastWrite; watcher.Changed += new FileSystemEventHandler(OnChanged); } private void OnChanged(object source, FileSystemEventHandler e) { StreamReader sr = new StreamReader(path + "talkbox.txt", true); String line; line = sr.ReadToEnd(); convers.Text = line; sr.Close(); }Pourriez vous m'aider s'il vous plait ?Aucune surcharge pour OnChanged ne correspond pas au delegue System.IO.FileSystemEventHandler.
Merci d'avance
Partager