How do i exit a C#?

  • Thread starter Thread starter Random Task
  • Start date Start date
Jim,

You can call the static Exit method on the Environment class, passing
111 for the exitCode parameter.

Hope this helps.
 
Random Task said:
I am looking for a call equivalent to:

exit (111);

What do i use in c#?

Well, what kind of app are you writing - a console app, a WinForms app,
a service?
 
Jon said:
Well, what kind of app are you writing - a console app, a WinForms app,
a service?
Console app ...

I am trying System.Environment.Exit right now :-)

I oddly did not suspect there to be an exit function there :-)

Jim
 
Change the return type of main to int instead void the default (void) and then
do:

return(111);
Console app ...

I am trying System.Environment.Exit right now :-)

I oddly did not suspect there to be an exit function there :-)

Jim
Otis
 
Back
Top