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 () =>
{
//处理其它事情
//希望返回后这个能继续执行
}}
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 () =>
{
//处理其它事情
//希望返回后这个能继续执行
}}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货