Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.IO.FileSystemWatcher issue
Message
 
À
17/06/2004 20:07:10
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00914845
Message ID:
00914895
Vues:
14
Oh yea, details... <g> I ought to know better. It's a WinForms app. This code is in the constructor after the InitializeComponents() line:

try
{
System.IO.FileSystemWatcher watcher = new System.IO.FileSystemWatcher();
watcher.Path = this.txtWatchForStartFile.Text.Trim();
watcher.Filter = "start.txt";
watcher.Created += new System.IO.FileSystemEventHandler(OnStartFileAppeared);
watcher.EnableRaisingEvents = true;
}
catch (Exception err)
{
MessageBox.Show(err.Message + "\n\nStack: " + err.StackTrace,
"Can Not Watch for start.txt file - Use GO NOW button");
}

And the method code...
public void OnStartFileAppeared(object source, System.IO.FileSystemEventArgs e)
{
this.btnGO_Click(source, e);
}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform