run winform to console

C

CSharper

I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....
 
M

mgsram

I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....

I may be completely wrong but it seems straightforward to me. I think
you should pass the file as argument to the Main method and write code
to parse the inputs from the file and set them to the respective UI
elements ( rather to the actual fields that the UI elements represent)
and trigger the logic. If you do not want the UI to appear, you can
simply add a branch in the main method for the count of input
arguments == 1. If its 0 show the UI. if not hide it.
 
C

CSharper

I may be completely wrong but it seems straightforward to me. I think
you should pass the file as argument to the Main method and write code
to parse the inputs from the file and set them to the respective UI
elements ( rather to the actual fields that the UI elements represent)
and trigger the logic. If you do not want the UI to appear, you can
simply add a branch in the main method for the count of input
arguments == 1. If its 0 show the UI. if not hide it.

Yes, I went back and looked at it, Winform is paunched from program.cs
there I put the logic to check and see if there is any parameters
passed, if it is passed then run as GUI else console. That will sove
my problem.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top