Passing Command-line arguments from C# to a external exe -
Passing Command-line arguments from C# to a external exe -
i have similar problem solved here. can not figure out, how problem got solved. have programme paramter define input , output file. running commend line, works fine:
d:\tools\siftdemov4>siftwin32.exe -display < d:\tmp\srcpgm\image000.pbm > result.pbm
but running via system.diagnostics.process, not work. error "invalid command line argument: <" , after system.invalidoperationexception occurs.
var process = new process() { startinfo = { arguments = string.format(@"-display < {0} > {1}", configuration.source, configuration.destination), filename = configuration.pathtoexternalsift, redirectstandarderror = true, redirectstandardinput = true, redirectstandardoutput = true, useshellexecute = false, createnowindow = true, errordialog = false, } }; process.enableraisingevents = true; process.exited += onprocessexited; process.outputdatareceived += new datareceivedeventhandler(process_outputdatareceived); process.errordatareceived += new datareceivedeventhandler(process_errordatareceived); process.start(); process.beginoutputreadline(); process.beginerrorreadline();
i tried write process.standardinput after called process.start(), when using debugger, external programme sometime finished (hasexited==true).
can explain how can pass special "<" ">" parameters programm?
best greetings!
by way, checked path multiple time, correct.
the parameter need -display
others not parameters programme , should handled by using redirectstandardinput
, redirectstandardoutput
e.g
read filed:\tmp\srcpgm\image000.pbm
write standardinput
of process read standardoutput
of process write result.pbm
using command redirection operators
c# command-line parameters
Comments
Post a Comment