正常来说,那么winform是获取不到EXE的返回值,这时我所用的方法是把EXE中的值写到csv文件中,然后winform去读取csv
private void btnGoodsSelect_Click(object sender, EventArgs e)
{
ParameterizedThreadStart pts = new ParameterizedThreadStart(RunCommand);
Thread FirstChildThread = new Thread(pts);
FirstChildThread.Start("Apsi.exe H111601010102I.psp +ARG -B " + basesCode + " -G " + txtGoods.Text.ToString() + " -S " + goodsSegment + "");
}
/// <summary>
/// 执行Commond命令
/// </summary>
/// <param name="CommandName">CommandName</param>
public void RunCommand(object CommandName)
{
if (process == null)
{
process = new Process();