Results 1 to 4 of 4

Thread: my console app closes right after the thing is displayed!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario, Canada
    Posts
    275

    my console app closes right after the thing is displayed!

    my console app closes right after the thing is displayed! how do i fix this?

  2. #2
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    If you set the startup object to Sub Main (ex. In console apps), when Main() finnishes, your program ends! To prevent this, you either have to:

    Design your app to keep Main() executing (Run a constant loop, for example).

    Or you can call System.Windows.Forms.Application.Run(), which basically runs such a loop in the background.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario, Canada
    Posts
    275
    or just that lol !

    Console.ReadLine()

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Or you can run it from the Visual Studio .NET Command Prompt, but that requires a little typing (you would Build Solution and then switch to the command prompt window and type the executable name)

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