Results 1 to 6 of 6

Thread: How to make a console application to not stop running ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    23

    How to make a console application to not stop running ?

    Do anyone know how to make a C# console application not to end when the code have beed run.

    I start a listning socket in my application but when the application
    reach the end of the code the application ends.


  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    System.Windows.Forms.Application.Run(); will do it stick that before the end of the Main routine.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    VB Code:
    1. Console.ReadLine();

    You have to request input to hold the console open. Its basically like the 'Press enter to exit' idea (but don't press enter).

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    23

    Thanxs

    Originally posted by Edneeis
    VB Code:
    1. Console.ReadLine();

    You have to request input to hold the console open. Its basically like the 'Press enter to exit' idea (but don't press enter).


    Thanxs!!!!

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    or run in not debug mode...that way it wont close

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    23

    Okej!..

    Thanxs!..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width