Environment Exit (??)
-
i'm new in C# and i'm a bit curious with something inside Environment Exit. don't care what number i put inside, it's just the same, so what is it for? Thanks before :laugh:
-
i'm new in C# and i'm a bit curious with something inside Environment Exit. don't care what number i put inside, it's just the same, so what is it for? Thanks before :laugh:
They invented "documentation", it is quite good at the level of classes and methods. And if you can't find it right away, a search engine could help you out. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
i'm new in C# and i'm a bit curious with something inside Environment Exit. don't care what number i put inside, it's just the same, so what is it for? Thanks before :laugh:
-
i'm new in C# and i'm a bit curious with something inside Environment Exit. don't care what number i put inside, it's just the same, so what is it for? Thanks before :laugh:
It's needless, don't use it.
-
They invented "documentation", it is quite good at the level of classes and methods. And if you can't find it right away, a search engine could help you out. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
Luc Pattyn wrote:
They invented "documentation"
And Microsoft killed it by eliminating actual manuals, providing us with MSDN in place of useful books. X|
Will Rogers never met me.
-
See this post http://geekswithblogs.net/mtreadwell/archive/2004/06/06/6123.aspx[^] I think it may be helpful to you.
+5 for informative link
Happy Coding... :)
-
+5 for informative link
Happy Coding... :)
-
Luc Pattyn wrote:
They invented "documentation"
And Microsoft killed it by eliminating actual manuals, providing us with MSDN in place of useful books. X|
Will Rogers never met me.
The only difference between a Microsoft book and MSDN is the binding is missing on MSDN.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
See this post http://geekswithblogs.net/mtreadwell/archive/2004/06/06/6123.aspx[^] I think it may be helpful to you.
Congratulations! You just gave him a fish instead of teaching him how to catch his own fish.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
It's needless, don't use it.
PIEBALDconsult wrote:
It's needless, don't use it.
No it isn't. If one creates a windows service and threads remain running when the service does a normal exit then the service will continue to run requiring one to kill it. Exit() terminates all threads. And if one wants to do dynamic batch processing or any other process management processing with executables then Exit() can be used to return information to the caller. This is normally going to be less useful than services but since the only way to truly isolate unmanaged code is in another process it can on rare occassions be useful.
-
PIEBALDconsult wrote:
It's needless, don't use it.
No it isn't. If one creates a windows service and threads remain running when the service does a normal exit then the service will continue to run requiring one to kill it. Exit() terminates all threads. And if one wants to do dynamic batch processing or any other process management processing with executables then Exit() can be used to return information to the caller. This is normally going to be less useful than services but since the only way to truly isolate unmanaged code is in another process it can on rare occassions be useful.
jschell wrote:
and threads remain running when the service does a normal exit
Then you're doing something wrong.
-
PIEBALDconsult wrote:
It's needless, don't use it.
No it isn't. If one creates a windows service and threads remain running when the service does a normal exit then the service will continue to run requiring one to kill it. Exit() terminates all threads. And if one wants to do dynamic batch processing or any other process management processing with executables then Exit() can be used to return information to the caller. This is normally going to be less useful than services but since the only way to truly isolate unmanaged code is in another process it can on rare occassions be useful.
i'm doing my C# animation project, just like i said, i'm new and i learned : * switch case * do while * if * environment exit all over google chrome with 20 tab yesterday. in result, i created a bouncing ball in box. the point is, i'm just curious WHAT IS 0 IN ENVIRONMENT EXIT. i searched all over the universe and what i found is just it is exit code to send to machine or whatever. what i need is just something more than that, NOT FISH. so don't think i'm not doing anything, and again, if you're not going to answer my question, don't post anything. i'm not the one who ask before stuck like hell. (although that thing didn't stuck my app) :laugh:
-
jschell wrote:
and threads remain running when the service does a normal exit
Then you're doing something wrong.
PIEBALDconsult wrote:
Then you're doing something wrong.
Presumably you in not having an correct way to shut down all threads, then I would agree to the extent that I would prefer to have such a method, and at least attempt that in my own code. But since some of the services I manage deal with disparate code sources (and developers) which might include up to 20 sources I can't insure that. Exit() however does insure it.
-
i'm doing my C# animation project, just like i said, i'm new and i learned : * switch case * do while * if * environment exit all over google chrome with 20 tab yesterday. in result, i created a bouncing ball in box. the point is, i'm just curious WHAT IS 0 IN ENVIRONMENT EXIT. i searched all over the universe and what i found is just it is exit code to send to machine or whatever. what i need is just something more than that, NOT FISH. so don't think i'm not doing anything, and again, if you're not going to answer my question, don't post anything. i'm not the one who ask before stuck like hell. (although that thing didn't stuck my app) :laugh:
Alpherattz wrote:
i'm just curious WHAT IS 0 IN ENVIRONMENT EXIT.
Traditionally zero means that the application exited 'successfully'. A positive value is considered an error and a negative a warning. HOWEVER, that is a very loose convention. If no value is specified then an application (standard desktop OSes) will always have a zero value.
Alpherattz wrote:
and again, if you're not going to answer my question, don't post anything.
Pretty sure that all of the posts were in fact "answers". The fact that they are not the answers you expected doesn't alter that.
-
PIEBALDconsult wrote:
Then you're doing something wrong.
Presumably you in not having an correct way to shut down all threads, then I would agree to the extent that I would prefer to have such a method, and at least attempt that in my own code. But since some of the services I manage deal with disparate code sources (and developers) which might include up to 20 sources I can't insure that. Exit() however does insure it.
jschell wrote:
disparate code sources (and developers)
Yep, sounds wrong to me. :-D (Not that I have any answers on how to fix it.)
-
i'm doing my C# animation project, just like i said, i'm new and i learned : * switch case * do while * if * environment exit all over google chrome with 20 tab yesterday. in result, i created a bouncing ball in box. the point is, i'm just curious WHAT IS 0 IN ENVIRONMENT EXIT. i searched all over the universe and what i found is just it is exit code to send to machine or whatever. what i need is just something more than that, NOT FISH. so don't think i'm not doing anything, and again, if you're not going to answer my question, don't post anything. i'm not the one who ask before stuck like hell. (although that thing didn't stuck my app) :laugh:
Environment.Exit(code) will help you exit the application in a safe manner.Basically you are sending a message to the system that the application exited on it own and was not terminated due to an error.If the application really has terminated to error it notifies the system what is the error code. 0 is to tell the system that the current running application exited safely without errors. You can get some info on these codes here http://www.hiteksoftware.com/knowledge/articles/049.htm[^]
Sastry