I have a WPF Application. It´s for testing a process. I start this over a console. When the process ends, the MainWindow will be closed with Window.Close(). Now I try to return a integer value when my program closes. It is possible to see this value in my console?
For example in Java has the method System.Exit(1). Then I can see the return value on my console. But is it possible in WPF Applications?
Mayb开发者_如何学Pythone this is also the solution bottle and somebody has a better idea.
You call:
Application.Current.Shutdown(1);
See this question for more info: How to exit a WPF app programmatically?
I believe you can call Environment.Exit(code)
msdn Environment.Exit
精彩评论