Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application.Exit()
Message
De
02/02/2006 01:15:34
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01092696
Message ID:
01092726
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Put a return after the Application.Exit().

~~Bonnie




>I ran accross something that I found a little odd. In my Main() I have something like this:
>
>// do some stuff
>
>if (something != somethingElse)
>{
>  MessageBox.Show("something is different from somethingElse so I will have to exit!");
>  Application.Exit();
>}
>
>// do some more stuff
>
>Application.Run(new Form1());
>
>
>Now if something was different from somethingElse I would expect Form1 never to be displayed, but it is. What am I missing?
>I know I can get around it by throwing an exception (yes Bonnie I know it is expensive <s>) or setting up some bool flags here and there and simply never doing the Application.Run but I don't understand why Exit doesn't exit. Maybe I am just to tierd now and this will all make sense in the morning :)
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform