[Mono-list] exit in a middle of the program

YyYo yossiozani at gmail.com
Sat May 2 03:51:18 EDT 2009


thanks for all...

3 options were given:
1) To return to Main() method and from there to call return;  => clumsy
options when I in method 3 and more level under the Main() method;
2) To call Application.Quit() is used to exit from the GUI main loop, and
not useful for console/batch programs.

3) The best options is to call System.Environment.Exit(0); which exit
instantly from the program.

Thanks Dan...


Dan Shryock wrote:
> 
>>> I am new to mono and C#.
>>> I am writing a simple program, and  question: is there a command to exit
>>> from the execution.
>>> like in python: sys.exit()
>>> or perl: exit()
> 
> System.Environment.Exit(0); will do the trick ;)
> 
> http://msdn.microsoft.com/en-us/library/system.environment.exit(VS.80).aspx
> 
> Hope that helps.
> 
> Dan
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: http://www.nabble.com/exit-in-a-middle-of-the-program-tp23341014p23343935.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list