473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Console application question

Hi.

I am playing a bit with console applications. I have a very simple Main
routine to show some text on the console:

Module Module1

Public Sub Main()
Console.WriteLine("Hello world")
End Sub

End Module

When I run the project, the DOS window opens and close automatically. I
can only see the message if I set a breakpoint on the code. Is it
possible to keep the DOS window open without a breakpoint?

Regards,

Chris Leffer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 5389
Hello,

"Chris Leffer" <ch****@wank.com> schrieb:
I am playing a bit with console applications. I have a very
simple Main routine to show some text on the console: [...] When I run the project, the DOS window opens and close
automatically. I can only see the message if I set a breakpoint on
the code. Is it possible to keep the DOS window open without a
breakpoint?


Add a call to 'Console.Read'. Notice that the console is _not_ a DOS
window!

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Hi Chris.
You have to go to command window (Is the execute textbox type "COMMAND" +
[Enter]),
browse to the sub directory where the .exe are, and execute the .exe using
command instruction, like

c:\My projects> Module1.exe [Enter]
regards

Carlos Barini
ca******@uol.com.br
Brasil

"Chris Leffer" <ch****@wank.com> wrote in message
news:#k**************@TK2MSFTNGP09.phx.gbl...
Hi.

I am playing a bit with console applications. I have a very simple Main
routine to show some text on the console:

Module Module1

Public Sub Main()
Console.WriteLine("Hello world")
End Sub

End Module

When I run the project, the DOS window opens and close automatically. I
can only see the message if I set a breakpoint on the code. Is it
possible to keep the DOS window open without a breakpoint?

Regards,

Chris Leffer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
Hi Herfried.

Your suggestion did the trick. And thanks for the clarification about
the console window :-)

Could you tell me what Console.Read does exactly? It seems some kind of
wait state.

Regards,

Chris Leffer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4
Hello,

"Chris Leffer" <ch****@wank.com> schrieb:
Could you tell me what Console.Read does exactly? It seems
some kind of wait state.


Read Method (.NET Framework Class Libarary)
http://msdn.microsoft.com/library/en...sreadtopic.asp

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Boba | last post by:
Hi, I'm programming a WinForm application. I would like to enter commands that will send output that will help me to locate bugs in the future. I know that there is a way to send output by...
4
by: Ron Vecchi | last post by:
I am looking for a way to write xml data to file from a macromedia flash executable. I was thinking about haveing flash call a console app with a parameter...which is the xml string to write to...
5
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough...
4
by: eduardorp1 | last post by:
I have a GUI application that needs to be invoked from the command line as well. It should work both as a GUI and as a console application. When I invoke it from the command line, it reads all...
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
2
by: SriBhargav | last post by:
Hi, I've a question on setting timeout on console.readline() I would like the user to input something through Console.readline() in 5 secs. If there is no input in that time, I would like to...
5
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
How can I send the Enter or Return keystroke to a VB.Net 2005 console application? -- Coding in Sunny Central Florida
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.