Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 2 console applications which i get output separately can i run both the applications on same page ??like
if we enter 1: output of 1 program
if we enter 2 : output of 2 nd program

if possible please explain the peocedure .??

What I have tried:

this is not a single line output program ,every program has again input and output options
Posted
Updated 9-Jan-17 23:13pm

When you asked a similar question yesterday: Can we convert console application in to web application in C#[^] it was about a single application, which you haven't got working yet (since you were still asking questions under an hour ago).
With two, it's getting worse, particularly when you want to run them "in a web page" - you cannot start apps on the client from a web page, or from the server - or malicious sites would kill or infect every machine that approached them - so the apps would have to run at the server. And since you need that "every program has again input and output options" the advice I gave you for the last question still applies: sit down, and work out what the UI should be, and recreate the app for the new environment. You are fast approaching the point where any other approach is going to give you more work to do than it could ever save you, as well as being next to impossible to maintain.
 
Share this answer
 
Well,

Every application has a single "Entry Point". In the case of console applications this will be the Main(string[] args) method.
Just like the Highlander, there can only be one!

You can, however, use console applications as referenced resources. The simplest example would be to have both console applications in the same project and a third "access" console app which references each of the two previous apps. The new "access" app will have to use the two referenced apps methods.

The best way to prepare the two console apps for this is to have almost nothing in each of their Main methods. Main just runs another public method that can be accessed by the "access" console app.

I hope that makes sense
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900