Bonjour à tous,

je fait une application qui lance un batch avec la commande 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
	prProcExport = new Process();
	prProcExport.StartInfo.FileName = _sBatch;
	prProcExport.StartInfo.Arguments = _sArgs;
 
	prProcExport.StartInfo.UseShellExecute = false;
	prProcExport.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
	prProcExport.StartInfo.CreateNoWindow = true;
	prProcExport.EnableRaisingEvents = true;
	prProcExport.StartInfo.RedirectStandardOutput = true;
 
	try
	{
		prProcExport.Start();
		prProcExport.BeginOutputReadLine();
	}
	catch (Exception e)
	{
		throw e;
	}
le batch contient des commandes d'export de base de donnée. Je souhaites rajouter la fonction d'annulation à mon application j'ai donc créé un bouton "annuler" avec le code suivant:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
prProcExport.Kill();
et cela ne fonctionne pas... Je n'ai pas de message d'erreur, mais il ne fait rien non plus. J'ai essayé avec Close() et CloseMainWindow(), pas plus de résultat.

Auriez-vous une idée ?

Merci.