I have an exe that I need to call from my C# Program with two arguments (PracticeId, ClaimId)
For example:
Suppose I have an application test.exe, whose functionality is to make a claim according to the given two arguments.
On cmd I would normally give the following command as:
test.exe 1 2
And it works fine and performs its job of conversion.
But I want to execute the same thing using my c# code. I am using the following sample code:
Process compiler = new Process();
compiler.StartInfo.FileName = "test.exe" ;
compiler.StartInfo.Arguments = "1 2" ;
compiler.StartInfo.UseShellExecute = true;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
When I try to invoke test.exe using the above code, it fails to perform its operation of making a claim txt file.
Where is the issue in this? Whether the problem is threading or not, I don't know.
Can someone please tell me what I need to change in the above code?