-one. Same as Environment.Exit (1)?
This is .NET, you barely knew which WINAPI they implemented for it without looking inside with windbg. However, nothing is documented about the similarities in ExitProcess and Environment.Exit . Environment.Exit may contain more than ExitProcess.
-2. What is better for an application that works as an automatic task?
If you are doing an automatic task using some kind of scheduler, then I also have another idea of using Windows services. This will eliminate any headache of exit exit.
-3. What do the exit codes -1, 0, 1 mean and what are their differences?
These are just codes to indicate the OS as a way out. You may have seen programmers pointing return 1 to error or return 0 to success. This allows you to use any of them.
-4. What about static void ExitProcess (uint uExitCode);
You can use unmanaged calls in your application, and of course you will skip management activities with Environment.Exit .
perilbrain
source share