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 file d:\tmp\srcpgm\image000.pbm write standardinput of process read standardoutput of process write result.pbm

using command redirection operators

c# command-line parameters

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -