Bonjour,
Bon voilà je dois lancer une application avec certains arguments.
La commande à exécuter passe très bien en dos, mais dès que je la met dans le start de l'objet process, cela bug :aie:
Donc mettant en cause mon code, j'ai fait différent essais, et j'ai constaté quelque chose qui me dépasse :aie:
Log est un objet qui gère mes fichiers log. La ligne de code ci dessus génère la ligne suivante dans le log :Code:Log.Write("\"" + XMLManager.Liste["ToolsPathExe"] + "\"" + " -t " + XMLManager.Liste["ToolScenName"] + " -l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\"");
Et vous savez quoi ? C'est tout à fait correct.Citation:
"C:\Program Files\TTworkbenchBasic\TTman.bat" -t SIP_RG_RR_V_004 -l c:\temp\ResultTest -r excel "C:\Documents and Settings\uspa8495\workspace\TTsuite-SIP_3.1.1\ttcn3\RFC3261\cf.clf"
Un copié collé de cette ligne dans la console dos et hop l'application se lance et fait ce qu'elle doit faire :)
D'ailleurs si je fait ceci :
Cela marche à merveille :)Code:Process.Start("\"C:\\Program Files\\TTworkbenchBasic\\TTman.bat\"", "-t SIP_RG_RR_V_004 -l c:\\temp\\ResultTest -r excel \"C:\\Documents and Settings\\uspa8495\\workspace\\TTsuite-SIP_3.1.1\\ttcn3\\RFC3261\\cf.clf\"");
Maintenant si j'essaye ce bout de code :
Ou celuic-ci (comme dans le Log.Write) :Code:Process.Start(XMLManager.Liste["ToolsPathExe"], "-t " + XMLManager.Liste["ToolScenName"] + "-l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\"");
Ou encore celui (exe, argument) :Code:Process.Start("\"" + XMLManager.Liste["ToolsPathExe"] + "\"" + " -t " + XMLManager.Liste["ToolScenName"] + "-l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\"");
Bah cela plante :arf: :mur: :bug:Code:Process.Start("\"" + XMLManager.Liste["ToolsPathExe"] + "\"", "-t " + XMLManager.Liste["ToolScenName"] + "-l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\"");
Et que dire de cette portion de code :
L'application se lance mais elle ne comprend pas certain argument :bug: :bug: :bug: :bug:Code:
1
2
3
4
5
6
7
8
9
10
11
12 Log.Write("TTWorkbenchManager.Run début"); TTWorkBench = new Process(); Log.Write("\"" + XMLManager.Liste["ToolsPathExe"] + "\"" + " -t " + XMLManager.Liste["ToolScenName"] + " -l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\""); TTWorkBenchInfo = new ProcessStartInfo("\"" + XMLManager.Liste["ToolsPathExe"] + "\"" + " -t " + XMLManager.Liste["ToolScenName"] + "-l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\""); //TTWorkBenchInfo.WindowStyle = ProcessWindowStyle.Hidden; //TTWorkBenchInfo.RedirectStandardOutput = true; //TTWorkBenchInfo.UseShellExecute = false; TTWorkBench.StartInfo = TTWorkBenchInfo; TTWorkBench.Start(); //Log.Write(TTWorkBench.StandardOutput.ReadToEnd()); TTWorkBench.WaitForExit(); Log.Write("TTWorkbenchManager.Run fin");
C'est à en devenir :fou:
Surtout que ma liste et les propriétés de mon outil tools renvois les bonnes valeur parce que :
M"ecrit dans le fichier la ligne de commande correcte, avec les bonnes valeurs.Code:Log.Write("\"" + XMLManager.Liste["ToolsPathExe"] + "\"" + " -t " + XMLManager.Liste["ToolScenName"] + " -l " + Tools.LocalPath + "\\ResultTest -r excel \"" + XMLManager.Liste["ToolsPathCampaign"] + "\"");
Alors là je suis totalement perdu, je ne comprend plus rien, je ne vois pas mon erreur.
:help:
Je vous remercie de m'avoir lu et de l'aide que vous pourrez m'apporter.
PS : Dites moi, pourquoi est ce toujours sur les classes les plus basiques, les taches les plus simple, les méthodes que l'on maitrise le mieux, que l'on perd le plus de temps ? Que cela bug constemment ???