index > Visual C# General > .exe quits after user input, when it is not suppose to

.exe quits after user input, when it is not suppose to

I wrote a program that checks the date for a leap year, what happends is when I compile and run the exe thru visual c#, it work fine. but when I go into my project folder and lunch the .exe file that I have created, it lunches the application, I enter the date and it just quits. Is there anyway to fix that?
TwilightBrigade

no idea why it would quit - what type of application is this? a winform or a command prompt? if its a command prompt, you would need to do read a user input before quiting as this is what it does - it goes straight ahead and quits unless there is a user input to be required, use something like :

string theInput = Console.ReadLine();

or something like this - it will wait and read the input from the user before continuing ahead




Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
ahmedilyas
I found the cause, I needed system("pause"); at the end of main, and it worked
TwilightBrigade
reply 3

You can use google to search for other answers

 

More Articles

• Remoting
• Using multiline regex's on more than one string object, ideas?
• Design-Time or Run-Time now ?
• Equivalent of IllegalArgumentException in C#
• Handling DVD Images with C#
• Packaging and Deployment Visual C# 2005
• MessageBox.Show()
• Odd Directory problem
• LPT1 CONTROL
• String to database
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Printing a PDF file
• Sharing Session betweem asp and asp.net
• Which exception to use for invalid prope
• detecting close button of browser in C#
• Is there a default property that returns
• deployment project
• All info about the user
• XML <include> for documentation
• how can i show a message if it wasn't us
• modify gridview according to listbox
• How to Send Email With embeded Images
• how to make an installation file for my
• incorrect syntax near '\'
• fullscreen
• Is it possible to leave variables uninit

Hot Articles

• Escape Sequence Character Doubles (\ end
• Send mouseclick event to webbrowser cont
• how to load and retrive an Image from Re
• Visual C# beta 1 crashing - help please
• Windows application to mobile phone appl
• How to design a class which can be used
• Images in DataGridView
• Editing Problems In Design Mode
• Problem when loading app: nothing shows
• Get an error when trying to start the ex
• SaveAll
• using JH.CommBase;using Microsoft.Win32;?
• How to change the column name in datagrid?
• How do I Retrieve MMS messages from a No
• Getting the OS version

Recommend Articles

• How to get the active application
• Handling large dataset
• How to test for values in a DataRow
• Searching in PDF files
• TreeView
• Attributes at DesignTime
• CreateGraphic().Clip?
• How to get lowest/minimum or highest/max
• C# Tutorials and books
• Request[] html
• Sending mail with C#
• accent problems
• how to add properties in Process.Start()?
• Getting the HTML of a web-page
• Where can I buy Visual C# 2005 Standard