WPF Application exit code

前端 未结 6 838
悲&欢浪女
悲&欢浪女 2020-12-17 15:39

I am trying to set and get the application exit code .

I am trying to do something following :

protected override void OnStartup(StartupEventArgs e)
         


        
6条回答
  •  生来不讨喜
    2020-12-17 16:29

    You can do this in the following ways...

            Application.Current.Shutdown(110);
            Environment.Exit(10);
            this.Close();
    

    Shoutdown() returns a code. and Exit() also returns an exit code, but Close() only closes the application.

提交回复
热议问题