C# et dos
younes12345
Messages postés
54
Statut
Membre
-
Joel -
Joel -
Bonjour,
comment peut t on executer de commande dos sous C# car je suis entrain de developper une application réseau.
des commandes comme Netstat, net view.....
comment peut t on executer de commande dos sous C# car je suis entrain de developper une application réseau.
des commandes comme Netstat, net view.....
Configuration: Windows 2003 Firefox 3.0.10
1 réponse
-
Salut younest,
Fais des recherches au niveau de ProcessStartInfo:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WorkingDirectory = MonAppli.workingDirectory;
startInfo.FileName = "\"" + cmd + "\"";
startInfo.Arguments = " " + parametres;
startInfo.RedirectStandardOutput = true;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
process = Process.Start(startInfo);
process.WaitForExit();
string stdout = process.StandardOutput.ReadToEnd();
process.Close();
En espérant que ça t'aide !