Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting a C#(windows application) into commadline application?
    primarykey
    data
    text
    <p>Could anyone please help me as how to convert a C#(windows platform application) into commandline version?</p> <p>The scenario is: I have implemented a C# (windows application) in VS 2010. The output of this application is to generate a txt(log) file ( in simple explanation). </p> <p>Now the case is, there is one other application which need to use my this C# application, by calling my C# application from the command line at the run time. </p> <p>My question is, how is it possible to convert an already existing C# application into commandline application, so that this C# application can be called from the calling (other) program? There is one input parameter which need to be passed on the commandline to my C# application. And then this C# application will process the data according to input parameter and then generate the output log(txt) file.</p> <p>Please guide, any suggestion will be highly appreciated!</p> <p>Added Explanation:</p> <p>Sorry for quite late reply, but I am really impressed by the solutions here. Just a bit more expertise is required from you Gurus that, I want one application only to work as both commandline application as well windows-application (forget to mention it before, sorry!), depending on the number of input parameter pass to the application. From this point of view, I have two options to implement it,</p> <p>1) Make separate functions for both applications (commandline and windows-forms). Call them according to the input parameter pass. In each function implement the complete functionality of each application without disturbing (or going into the code of other application). Also I will be able to re-use 2 main functions, already built in windows-form application into my commandline application after some editing.</p> <p>Disadvantage: This will make the code size nearly 50% more than case 2.</p> <p>2) The second idea is same as describe by one of the expert here, to use the same application/functions for commandline as that of already built windows-form application. The only way to distinguish is to look at the input parameter pass, and decide accordingly whether to show the GUI interface or just use the commandline input (and do processing). </p> <p>Disadvantage: This case will make the code bit messy and difficult to maintain/implement due to extra adding of check for number of input parameter decisions.</p> <p>Please advice which strategy should i need to follow for implementation.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload