Jump to content

C# ending a program

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
Hello,

I am making a simple program using if else and jumps loop, but i wanted it to say if quit, then say good bye and in a few seconds close the command prompt, but every time i hit quit it closes right away, is there a code where it would be... console.writeline ("good bye"); then it would count down (the count down does not have to show) within a few seconds or whatever then close the program?

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
How about this:
System.Threading.Thread.Sleep(3000);
But it just after the goodbye bit, at the end of the code. The number is the number of milliseconds to wait.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
gaylo565

gaylo565

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 268 posts
That's how I'd do it;)

#4
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
THATS IT thanks !! now i am going to post my little easy tutorial goto/if else/jump loop program in tutorial with the System.Threading.Thread.Sleep(3000); thing you added.