.NET(C#の)にprocess.start()によって呼び出された三つの方法の終了を知る方法Process.start()
と異なる引数を渡します。これらの3つの実行が終了したら、私はメソッドを実行したい(3つのメソッドを完了した後にのみ)。 これは、ここに私の質問には三つの方法Processfiles("TCS");,Zipfiles("RCS");,Leveragefiles("CTS");
の完了後Downloadfiles();
メソッドを実行する方法です私はsecond.exe
<code>first</code>を使用して<code>second</code> exeファイルを3回起動されている<code>first.exe</code>と<code>second.exe</code>という名前の私は2つのexeファイル(2つのコンソールアプリケーションを)持っている
static void Main(string[] args)
{
if (args[0] == "TC" && args[1] == "CS")
{
Processfiles("TCS");
}
if (args[0] == "RC" && args[1] == "CS")
{
Zipfiles("RCS");
}
if (args[0] == "CC" && args[1] == "CS")
{
Leveragefiles("CTS");
}
Downloadfiles();
}
に3回の呼び出しを処理しています方法です。ここでコードがsecond.exe
を開始するために使用完了の3つの方法の時間が異なる時間に異なる
は、あなたがこのためにスレッドタスクを使用することができます
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = System.Configuration.ConfigurationManager.AppSettings["PathExe"];
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow dtr in ds.Tables["testG"].Rows)
{
startInfo.Arguments = dtr["TC_CODE"].ToString() + " " + dtr["CC_CODE"].ToString();
Process.Start(startInfo);
// System.Diagnostics.Process.Start(System.Configuration.ConfigurationManager.AppSettings["PathExe"], dtr["VENDOR_CODE"].ToString() + " " + dtr["TECH_CODE"].ToString());
}
}
}
catch (Exception ex)
{
mail.SendMail2(System.Configuration.ConfigurationManager.AppSettings["EmailFrom"], System.Configuration.ConfigurationManager.AppSettings["EmailCc"], null, ex.Message, "error", true);
log.Error(ex.Message);
}
'second.exe'を起動するために使用しているコードを表示できますか? –
@BJ Myers、私の質問を編集しました – peter