When to choose Windows Application or Console Application
-
Hi Guys I am relative new to Visual Studio... I'm about to do some calculations on my data and I was wondering if anybody can tell me the difference between choosing a Windows application or Console application when starting a project and what is the difference. Seems to me, to be easier to implement my algorithms in a console, because it is possible to get the data output in the commando-prompt (don't know how to do this in an application) and later on when designing the GUI I could change it over to an application, is this possible..? Thanks in advance AL
-
Hi Guys I am relative new to Visual Studio... I'm about to do some calculations on my data and I was wondering if anybody can tell me the difference between choosing a Windows application or Console application when starting a project and what is the difference. Seems to me, to be easier to implement my algorithms in a console, because it is possible to get the data output in the commando-prompt (don't know how to do this in an application) and later on when designing the GUI I could change it over to an application, is this possible..? Thanks in advance AL
Not good design. That was applicable if the GUI would take a lot of programming, but now in C# all you usually do is drag/drop. you want to display your output. It could be as easy as:
MessageBox.Show(MyOutputString);
or
MessageBox.Show(MyOutputInt.ToString());
Another way is to show it in a TextBox control:
MyTextBox.Text = MyOutputString;// or MyOutputInt.ToString()
You usually make a consol application when you don't need a user interface. e.g. a command line tool. If you will need a user interface, you should start a windows application from the beginning. If you don't know how to make a user interface in C#, learning it would be as easy as reading a comic book. Either grab a book, or screw thing up yourself with the designer till you get it right -I don't think it would be that way-. You can even download some free video tutorials on that from the net.
Regards:rose:
-
Hi Guys I am relative new to Visual Studio... I'm about to do some calculations on my data and I was wondering if anybody can tell me the difference between choosing a Windows application or Console application when starting a project and what is the difference. Seems to me, to be easier to implement my algorithms in a console, because it is possible to get the data output in the commando-prompt (don't know how to do this in an application) and later on when designing the GUI I could change it over to an application, is this possible..? Thanks in advance AL
ComCoderCsharp wrote:
Windows application or Console application
There is no major difference apart from the fact that in a Console application the console is displayed. In a windows one you can write stuff to the console (standard input / output / error) but nothing will be displayed or read.
ComCoderCsharp wrote:
Seems to me, to be easier to implement my algorithms in a console
It doesn't really matter, displaying the data initially might be easier with a console.
ComCoderCsharp wrote:
(don't know how to do this in an application)
The simplest solution would be to drop a textbox onto the form and append data to that using the
TextBox.AppendText
method.ComCoderCsharp wrote:
later on when designing the GUI I could change it over to an application, is this possible..?
Yes, just open the property pages and change the output type to Windows Application rather than console, all this does is change a command-line option when calling the C# compiler.
I have no idea what I just said. But my intentions were sincere.
-
Hi Guys I am relative new to Visual Studio... I'm about to do some calculations on my data and I was wondering if anybody can tell me the difference between choosing a Windows application or Console application when starting a project and what is the difference. Seems to me, to be easier to implement my algorithms in a console, because it is possible to get the data output in the commando-prompt (don't know how to do this in an application) and later on when designing the GUI I could change it over to an application, is this possible..? Thanks in advance AL
A Console Application shows the console window while a Windows Application does not. Both a Console Application and a Windows Application can open forms - so you could always use a console application and output logging information on the console (if you don't like Debug.WriteLine). Unlike forms, the console window content will be visible even if your application is not responding. For the release builds, you could then just switch to a Windows Application.
-
A Console Application shows the console window while a Windows Application does not. Both a Console Application and a Windows Application can open forms - so you could always use a console application and output logging information on the console (if you don't like Debug.WriteLine). Unlike forms, the console window content will be visible even if your application is not responding. For the release builds, you could then just switch to a Windows Application.
This really cleared things up - I think I will use an application and view tha data in a gui box all the best Al