Unable to run .exe application using C# code

Posted by bjh Hans on Stack Overflow See other posts from Stack Overflow or by bjh Hans
Published on 2010-03-31T04:06:24Z Indexed on 2010/03/31 4:43 UTC
Read the original article Hit count: 320

Filed under:
|

I have an exe that i need to call from my C# Program with two arguments(PracticeId,ClaimId)

for example Suppose if i have an application "test.exe" , whose functionality is to make claim acording to given two argument 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 what if 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 the test.exe using the above code , it fails to perform its operation of making claim txt file

what is the issue in this i don' know pls help me regarding this whether the problem of threding or not i don't know.

Can anyone tell me if i need to add anything more to the above code

It would be great if somebody could provide some help on the above topic.

© Stack Overflow or respective owner

Related posts about c#.net

Related posts about c#3.0