How to make a console application that can choose to have UI


Description of Problem:

Ok, I’m a uni student working on a c# networking topic. We have to make 2 programs, a server and a client. the server holds a dictionary that contains a “lookup” and a “location”. The client can request a lookup’s location from the server, or set the location of a lookup. both the client and the server communicate through TCP using different formats: whois, HTTP0.9, HTTP1.0, HTTP1.1.

The client is run from a command prompt and can be called with arguments. E.g “-h” will connect you to google, “-p 40” will change the port to 40.

location.exe -p 43 -h 

However, the client can also be called without using arguments. In this situation, the program, which is called through the same exe, must open a UI with input boxes for each of the possible arguments.


In the past we have never created a program like this. It has either been a console application or a WPF application, not a mix. My lecturer has given us no sources of information on how to approach this. I have had a look myself but most of the approaches I have found seem to be using methods that are rather messy.

The Question:

Since I actually want to learn, I don’t exactly want a word for word “this is what you must copy and paste”. However, what I would like is, if it is not too much trouble, a description of a few possible approaches to this and their strengths and weaknesses.

For example, I could use the console to just ask the user argument by argument something similar to “what port would you like?”, but my lecturer has said “that doesn’t seem interesting enough, does it”.

Thank you in advance

submitted by /u/lucius10203
[link] [comments]

Leave a Reply