HttpRequest 处理

HttpRequest Handling

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

Step 1: Initiating a web request
Step 3: Process the request on web server. 有很多方法可以做到这一点。这就是使用 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);
        }

您可以在此处阅读有关流程 class 的更多信息:

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