HttpRequest Handling

本文关键字:Handling HttpRequest | 更新日期: 2023-09-27 18:34:34

多线程环境中处理大量http请求的最佳方法是什么?

HttpRequest Handling

步骤 1:发起 Web 请求
第 3 步:在 Web 服务器上处理请求。有很多方法可以做到这一点。这就是使用 asp.net Web API 的方式。

下面是第 2 步。

我认为这就是你所追求的:

Process myProcess = new Process();
        try
        {
            myProcess.StartInfo.UseShellExecute = false;
            // You can start any process, HelloWorld is a do-nothing example.
            myProcess.StartInfo.FileName = "C:''HelloWorld.exe";
myProcess.StartInfo.Arguments = "your arguments go here";
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.Start();
            // This code assumes the process you are starting will terminate itself. 
            // Given that is is started without a window so you cannot terminate it 
            // on the desktop, it must terminate itself or you can do it programmatically
            // from this application using the Kill method.
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }

您可以在此处阅读有关 Process 类的更多信息:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110(.aspx