Oppure

Loading
19/03/15 14:00
fosforo
Ciao
Ho creato un pulsante per poter lanciare un eseguibile e leggerne il suo output:

private void button5_Click(object sender, EventArgs e)
{
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "C:\Program Files\MediaInfo_CLI\MediaInfo.exe" + "--help";
//MessageBox.Show(openFileDialog1.FileName);
    start.UseShellExecute = false;
    start.RedirectStandardOutput = true;
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
string result = reader.ReadToEnd();
MessageBox.Show (result);
}
}

Purtroppo si ferma sul Process.Start(start)) dandomi:
Win32Exception non è gestita.

Non riesco a trovare la soluzione.

Grazie anticipatamente.
aaa
19/03/15 14:30
fosforo
Ciao
Ho risolto

Devo dare gli argomenti in questo modo:
start.FileName = "C:\Program Files\MediaInfo_CLI\MediaInfo.exe"
start.Arguments = " --Help";
aaa
19/03/15 14:33
Ultimo
usa il controllo delle eccezzioni

If ok Then GOTO Avanza else GOTO Inizia