Comment lancer un executable AVEC des arguments depuis le code avec Process ?
Bonjour,
Je me suis aider des conseils sur ce forum.Mais je n'arrive toujours pas a passer des arguments a mon executable. L'executable se lance correctement mais aucun de mes arguments n'est pris en compte d'apres la sortie imprimee a l'ecran.
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Process proc = new System.Diagnostics.Process();
String javalaunch = "\"" + Environment.GetEnvironmentVariable("JAVA_HOME") + "\\bin\\java\"";
String envCP = "-classpath"\"" + Environment.GetEnvironmentVariable("JAR_DIR") + "\\cxx_dev-rt.jar;" + Environment.GetEnvironmentVariable("BASE_DIR") + "\\lib\\ava_dev_code_gen\\" + Environment.GetEnvironmentVariable("VERSION") + "\\lm.jar\"";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.FileName = javalaunch;
proc.StartInfo.Arguments = envCP; //+ licenseFile;
proc.Start();
string output = proc.StandardOutput.ReadToEnd();
Console.WriteLine(output); // POUR VOIR LES DONNEES DE SORTIE
proc.WaitForExit();
proc.Close(); |
les arguments sont correct car si je passe ces arguments crees dans le pormpt ca marche !
Comment faire pour resoudre ce probleme . Je tourne en rond. Je regarde la doc sur la classe process mais j'ai l'impression que tout est correct.
Commentaires ?