web api代码:
  Process p = new Process();
  p.StartInfo.UseShellExecute = false;
  p.StartInfo.RedirectStandardOutput = true;
  p.StartInfo.FileName = @"C://1.exe";
  p.StartInfo.CreateNoWindow = true;
 p.StartInfo.Arguments = "JPG"; 
p.Start();
p.WaitForExit();
string FrameCount = p.StandardOutput.ReadLine();1.exe控制台代码:
  static void Main(string[] args)
{
       int  frameCount =  ReadFrameRate( );//获取参数
       Console.Write(frameCount);  //直接返回参数 ,希望在这个地方就返回不需要等待下面的代码执行           
       Task.Run(async () =>
       {
             //处理其它事情 
            //希望返回后这个能继续执行
       }}