C# programs close after ran

Aug 6, 2009 at 2:05am
I'm a beginner to C#, and my programs close after I run them!
What function do I use?
Aug 6, 2009 at 2:41am
Try to run using ctrl + F5 but not only F5 (debug) !!
Aug 6, 2009 at 3:28am
Err, you're in the wrong forum, bud. This is C++ not C#.

Anyway, in C++ most people can counter this problem with system("PAUSE"). There's another way, but I'm not sure what the code would be in C#.
Hope that helps.

Edit:
Actually, it'd be easier if you simply had your user enter 'exit' when they wish to exit, and then do an infinite loop of the function until the user wants to exit.
Last edited on Aug 6, 2009 at 3:28am
Aug 6, 2009 at 5:47am
if you're working with console try this:
 
Console.ReadKey();
Topic archived. No new replies allowed.