Whats the best way to handle a lot of http requests in a multithreaded environment ?
Asked
Active
Viewed 74 times
0
-
Do you want to perform an HTTP request, start an application or both? What have you tried? – CodeCaster Feb 13 '16 at 02:12
-
I mean what kind of answer are you looking for? – CodeCaster Feb 13 '16 at 13:42
-
I'm trying to ask with **which part specifically** you need help. All of your separate questions (_"How to perform an HTTP request"_, _"How to start an executable"_, _"How to read a file"_) have been asked and answered before. – CodeCaster Feb 13 '16 at 13:52
-
When you have a programming problem, you need to split it up into several steps that you do know how to solve, or that you can research. I did that for you in my previous comment. Your question asks for multiple things, all of which have been discussed before. It's not clear to me with what part specifically you need help and what you have tried. – CodeCaster Feb 13 '16 at 14:04
1 Answers
0
Step 1: Initiating a web request
Step 3: Process the request on web server. There are many ways to do this. This is how you would do it using asp.net web api.
Below is Step 2.
I think this is what you are after:
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);
}
You can read more about Process class here:
https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx

CodingYoshi
- 25,467
- 4
- 62
- 64
-
-
Glad I can help. One more thing, I am not sure how the executable will do the processing but [this](http://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output) may help to get the result from the exe. – CodingYoshi Feb 13 '16 at 20:22